]> gitweb.fperrin.net Git - djsite.git/blobdiff - quotes/models.py
Revert "Use django-tagging for tags"
[djsite.git] / quotes / models.py
index 7539152451509845f8e984c31bbd16c2dd4ddb69..0fa66afd0ed91e8e076bd7d674c068246ef09b46 100644 (file)
@@ -1,7 +1,12 @@
 from django.db import models
-from localmodels import HTMLField, TagField
+from localmodels import HTMLField
 
 # 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")
@@ -11,7 +16,7 @@ class Author(models.Model):
     pvt_notes = HTMLField(blank=True, help_text= \
                           "Notes about the author; not displayed on \
                           the public interface",)
-    tags = TagField()
+    tags = models.ManyToManyField(Tag, blank=True)
 
     birth_date = models.DateField(blank=True, null=True,
                                   help_text="Date of birth")
@@ -48,7 +53,7 @@ class Work(models.Model):
     author = models.ForeignKey(Author)
     date = models.DateField(blank=True, null=True,
                             help_text="Date of the quote")
-    tags = TagField()
+    tags = models.ManyToManyField(Tag, blank=True)
 
     notes = HTMLField(blank=True, help_text= \
                       "Notes about the work; may be left blank. Will \
@@ -62,7 +67,7 @@ class Work(models.Model):
 
 class Quote(models.Model):
     text = HTMLField()
-    tags = TagField()
+    tags = models.ManyToManyField(Tag, blank=True)
     work = models.ForeignKey(Work)
 
     notes = HTMLField(blank=True, help_text= \