From 5a7466204b4030873405b1a0fcb8b208762453ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 31 May 2018 15:04:45 +0300 Subject: Ability to pin posts, updated to bootstrap 4, fixes --- weblog/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 weblog/models.py (limited to 'weblog/models.py') diff --git a/weblog/models.py b/weblog/models.py old mode 100644 new mode 100755 index 80e917e..3c4935e --- a/weblog/models.py +++ b/weblog/models.py @@ -11,7 +11,7 @@ class Category(models.Model): def get_absolute_url(self): return reverse('weblog:CategoryIndex', kwargs={'category_slug': self.slug}) - + def __str__(self): return self.name @@ -44,6 +44,8 @@ class BlogPost(models.Model): original_language = models.CharField(max_length=5, verbose_name=_('Original language (ISO)'), blank=True) slug = models.SlugField(max_length=100, verbose_name=_('Slug (URL)'), db_index=True, unique=True) categories = models.ManyToManyField(Category, verbose_name=pgettext_lazy('Post categories', 'Categories'), blank=True) + pinned = models.BooleanField(verbose_name=_('Pin blog post'), default=False) + pin_priority = models.IntegerField(verbose_name=_('Pinned post priority (if pinned)'), default=0) published = models.BooleanField(verbose_name=pgettext_lazy('Make post viewable', 'Published')) publish_date = models.DateTimeField(verbose_name=_('Publish date')) @@ -90,4 +92,4 @@ class PostCommentForm(ModelForm): labels = {'content': ''} widgets = { 'content': Textarea(attrs={'class': 'form-control', 'rows': '5'}), - } \ No newline at end of file + } -- cgit v1.2.3