From 113d217a051b5644061876c64b27da1281e49041 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Wed, 3 Sep 2008 17:36:50 +0200 Subject: [PATCH] Added Fragment model to catalogue app. --- catalogue/models.py | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/catalogue/models.py b/catalogue/models.py index ba41638c6..71c89a234 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -128,27 +128,17 @@ class Book(models.Model): return self.title -# class Fragment(models.Model): -# id = models.IntegerField(primary_key=True) -# text = models.TextField(blank=True) -# start_paragraph = models.IntegerField(null=True, blank=True) -# book_id = models.IntegerField(null=True, blank=True) -# class Meta: -# db_table = u'fragment' - - -# class Inflections(models.Model): -# word = models.CharField(max_length=120, primary_key=True) -# cases = models.TextField() # This field type is a guess. -# class Meta: -# db_table = u'inflections' - - -# class Paragraph(models.Model): -# id = models.IntegerField(primary_key=True) -# number = models.IntegerField(null=True, blank=True) -# text = models.TextField(blank=True) -# book_id = models.IntegerField(null=True, blank=True) -# class Meta: -# db_table = u'paragraph' +class Fragment(models.Model): + text = models.TextField() + short_text = models.TextField() + anchor = models.IntegerField() + book = models.ForeignKey(Book) + + objects = managers.ModelTaggedItemManager(Tag) + tags = managers.TagDescriptor(Tag) + + class Meta: + ordering = ('book', 'anchor',) + verbose_name = _('fragment') + verbose_name_plural = _('fragment') -- 2.20.1