base setup
This commit is contained in:
17
at_django_boilerplate/blogs/models.py
Executable file
17
at_django_boilerplate/blogs/models.py
Executable file
@@ -0,0 +1,17 @@
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from at_django_boilerplate.utils.mixins import UUIDMixin
|
||||
|
||||
class Blog(UUIDMixin):
|
||||
title = models.CharField(max_length=80,null=True,blank=True)
|
||||
content = models.TextField(null=True,blank=True)
|
||||
cover_image = models.ImageField(upload_to='blogs',null=True,blank=True)
|
||||
meta_title = models.CharField(max_length=80,null=True,blank=True)
|
||||
meta_description = models.CharField(max_length=180,null=True,blank=True)
|
||||
meta_keywords = models.CharField(max_length=100,null=True,blank=True)
|
||||
published_on = models.DateTimeField(auto_created=True,default=timezone.now)
|
||||
published_by = models.ForeignKey('accounts.CustomUser',null=True,blank=True,on_delete=models.DO_NOTHING)
|
||||
is_draft = models.BooleanField(default=True)
|
||||
is_active = models.BooleanField(default=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user