X-Git-Url: http://gitweb.fperrin.net/?p=djsite.git;a=blobdiff_plain;f=quotes%2Fmodels.py;h=7539152451509845f8e984c31bbd16c2dd4ddb69;hp=0fa66afd0ed91e8e076bd7d674c068246ef09b46;hb=5c563ff1701456a2ca7108a301e4e48457475daa;hpb=242b0beb0eff7c97205b0bbe3747118b70ff1ee9 diff --git a/quotes/models.py b/quotes/models.py index 0fa66af..7539152 100644 --- a/quotes/models.py +++ b/quotes/models.py @@ -1,12 +1,7 @@ from django.db import models -from localmodels import HTMLField +from localmodels import HTMLField, TagField # Create your models here. -class Tag(models.Model): - tag = models.CharField(max_length=100) - def __unicode__(self): - return self.tag - class Author(models.Model): name = models.CharField(max_length=100, help_text="Name of the author") @@ -16,7 +11,7 @@ class Author(models.Model): pvt_notes = HTMLField(blank=True, help_text= \ "Notes about the author; not displayed on \ the public interface",) - tags = models.ManyToManyField(Tag, blank=True) + tags = TagField() birth_date = models.DateField(blank=True, null=True, help_text="Date of birth") @@ -53,7 +48,7 @@ class Work(models.Model): author = models.ForeignKey(Author) date = models.DateField(blank=True, null=True, help_text="Date of the quote") - tags = models.ManyToManyField(Tag, blank=True) + tags = TagField() notes = HTMLField(blank=True, help_text= \ "Notes about the work; may be left blank. Will \ @@ -67,7 +62,7 @@ class Work(models.Model): class Quote(models.Model): text = HTMLField() - tags = models.ManyToManyField(Tag, blank=True) + tags = TagField() work = models.ForeignKey(Work) notes = HTMLField(blank=True, help_text= \