From 9aa59dfa55c9fe61c7b7dba58b2008ca90749976 Mon Sep 17 00:00:00 2001 From: Sadra Date: Wed, 17 Aug 2022 21:53:15 +0430 Subject: [PATCH] featured flag added for blogs --- blog/migrations/0005_blog_is_featured.py | 18 ++++++++++++++++++ blog/models.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 blog/migrations/0005_blog_is_featured.py diff --git a/blog/migrations/0005_blog_is_featured.py b/blog/migrations/0005_blog_is_featured.py new file mode 100644 index 0000000..459139f --- /dev/null +++ b/blog/migrations/0005_blog_is_featured.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.6 on 2022-08-17 17:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("blog", "0004_tag_blog_tags"), + ] + + operations = [ + migrations.AddField( + model_name="blog", + name="is_featured", + field=models.BooleanField(default=False), + ), + ] diff --git a/blog/models.py b/blog/models.py index 45d6f62..7517365 100644 --- a/blog/models.py +++ b/blog/models.py @@ -16,6 +16,7 @@ class Blog(models.Model): body = models.TextField() tags = models.ManyToManyField(Tag, blank=True) slug = models.SlugField(unique=True, editable=False) + is_featured = models.BooleanField(default=False) published_at = models.DateTimeField(auto_now=True) def __str__(self) -> str: