X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0cae17bec6d31806615fae59a5b3945016285fbe..6a7e065304db77a5588713cdfe6f81f7f4609540:/apps/catalogue/models.py?ds=sidebyside diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index 9786150e6..db194347e 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -34,12 +34,13 @@ class TagSubcategoryManager(models.Manager): class Tag(TagBase): name = models.CharField(_('name'), max_length=50, unique=True, db_index=True) - slug = models.SlugField(_('slug'), unique=True, db_index=True) - sort_key = models.SlugField(_('sort key'), db_index=True) + slug = models.SlugField(_('slug'), max_length=120, unique=True, db_index=True) + sort_key = models.SlugField(_('sort key'), max_length=120, db_index=True) category = models.CharField(_('category'), max_length=50, blank=False, null=False, db_index=True, choices=TAG_CATEGORIES) - description = models.TextField(blank=True) - + description = models.TextField(_('description'), blank=True) + main_page = models.BooleanField(_('main page'), default=False, db_index=True, help_text=_('Show tag on main page')) + user = models.ForeignKey(User, blank=True, null=True) def has_description(self): @@ -70,7 +71,7 @@ class Tag(TagBase): class Book(models.Model): title = models.CharField(_('title'), max_length=120) - slug = models.SlugField(_('slug'), unique=True, db_index=True) + slug = models.SlugField(_('slug'), max_length=120, unique=True, db_index=True) description = models.TextField(_('description'), blank=True) created_at = models.DateTimeField(_('creation date'), auto_now=True) _short_html = models.TextField(_('short HTML'), editable=False) @@ -207,7 +208,7 @@ class Fragment(models.Model): text = models.TextField() short_text = models.TextField(editable=False) _short_html = models.TextField(editable=False) - anchor = models.IntegerField() + anchor = models.CharField(max_length=120) book = models.ForeignKey(Book, related_name='fragments') objects = models.Manager()