From 7fc1680165d8334dcac541883b03776082b80ad5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Sat, 6 Sep 2008 19:33:31 +0200 Subject: [PATCH 1/1] Renamed ModelTagManager on Book and Fragment models to tagged and added new default manager to these models. --- catalogue/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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): -- 2.20.1