diff options
author | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-05-31 15:04:45 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-05-31 15:04:45 +0300 |
commit | 5a7466204b4030873405b1a0fcb8b208762453ee (patch) | |
tree | bc73cccb953b6ba25afdb7dffbee505a296e94ac /weblog/models.py | |
parent | be41310b3dc4aec12d3a950cf9fe737811436499 (diff) | |
download | w3blog-5a7466204b4030873405b1a0fcb8b208762453ee.tar.gz w3blog-5a7466204b4030873405b1a0fcb8b208762453ee.zip |
Ability to pin posts, updated to bootstrap 4, fixes
Diffstat (limited to 'weblog/models.py')
-rwxr-xr-x[-rw-r--r--] | weblog/models.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weblog/models.py b/weblog/models.py index 80e917e..3c4935e 100644..100755 --- 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 + } |