How to use the djutils.features.fuzzydate.FuzzyDateField function in djutils

To help you get started, we’ve selected a few djutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ALBAstryde / albastryde / biblioteca / models.py View on Github external
nombre = models.CharField(max_length=200, help_text="Por favor ingrese el nombre de la Organización o Editorial", verbose_name="Nombre")
	
	def __unicode__(self):
		return self.nombre

class PalabraClave(models.Model):
	palabra = models.CharField(unique=True,max_length=50)

	def __unicode__(self):
		return self.palabra


class Documento(models.Model):
	nombre = models.CharField(max_length=200, help_text="Por favor ingrese le titulo del documento", verbose_name="Titulos")
	autor = models.ForeignKey(Autor, verbose_name="Autor")
	fecha_publicado = FuzzyDateField(verbose_name="Fecha de publicacion")
	fecha_anadido = models.DateTimeField(editable=False, auto_now_add=True, verbose_name="Fecha añadido")
	descripcion = models.TextField(max_length=200, verbose_name="Descripcion")
	organizacion = models.ForeignKey(Editorial, verbose_name="Organizacion")
	enlace = models.URLField(verbose_name="Enlace o Link", null=True, blank=True)
        index = djangosearch.ModelIndex(text=['nombre','descripcion'])
	palabras_claves = models.ManyToManyField(PalabraClave)
	attachment = models.FileField(upload_to="upload/documentos", verbose_name="Archivo adjunto", help_text="ADVERTENCIA: solo añadir un archivo *.pdf", null=True, blank=True)

	def get_absolute_url(self):
		return '%s%s/%s' % (settings.MEDIA_URL, settings.ATTACHMENT_FOLDER, self.id)

	def get_download_url(self):
		return '%s%s' % (settings.MEDIA_URL, self.attachment)

	def __unicode__(self):
		return self.nombre

djutils

Utilities for use with the django web framework

LGPL-2.1
Latest version published 1 year ago

Package Health Score

38 / 100
Full package analysis