From: Marek Stępniowski Date: Sat, 6 Sep 2008 17:33:31 +0000 (+0200) Subject: Renamed ModelTagManager on Book and Fragment models to tagged and added new default... X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/7fc1680165d8334dcac541883b03776082b80ad5?ds=sidebyside Renamed ModelTagManager on Book and Fragment models to tagged and added new default manager to these models. --- diff --git a/catalogue/models.py b/catalogue/models.py index 114b34bdd..f3f6bc2d5 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -81,9 +81,10 @@ class Book(models.Model): odt_file = models.FileField(_('ODT file'), upload_to='books/odt', blank=True) html_file = models.FileField(_('HTML file'), upload_to='books/html', blank=True) - parent = models.ForeignKey('self', blank=True, null=True) + parent = models.ForeignKey('self', blank=True, null=True, related_name='children') - objects = managers.ModelTaggedItemManager(Tag) + objects = models.Manager() + tagged = managers.ModelTaggedItemManager(Tag) tags = managers.TagDescriptor(Tag) def short_html(self): @@ -209,7 +210,8 @@ class Fragment(models.Model): anchor = models.IntegerField() book = models.ForeignKey(Book, related_name='fragments') - objects = managers.ModelTaggedItemManager(Tag) + objects = models.Manager() + tagged = managers.ModelTaggedItemManager(Tag) tags = managers.TagDescriptor(Tag) def short_html(self):