X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/52a0445217d261027b003f6f300c1e0d6a3553eb..3199cbfa76c763b4082b5a8d8f971d74f67e27c0:/catalogue/models.py?ds=sidebyside 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):