no more apache2
This commit is contained in:
parent
ba112f7166
commit
d8bd75003b
79 changed files with 52 additions and 27 deletions
23
sciodog-app/app/blog/models.py
Normal file
23
sciodog-app/app/blog/models.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
# Create your models here.
|
||||
STATUS = (
|
||||
(0,"Draft"),
|
||||
(1,"Publish")
|
||||
)
|
||||
|
||||
class Article(models.Model):
|
||||
title = models.CharField(max_length=200, unique=True)
|
||||
slug = models.SlugField(max_length=200, unique=True)
|
||||
author = models.ForeignKey(User, on_delete= models.CASCADE,related_name='articles')
|
||||
updated_on = models.DateTimeField(auto_now= True)
|
||||
content = models.TextField()
|
||||
created_on = models.DateTimeField(auto_now_add=True)
|
||||
status = models.IntegerField(choices=STATUS, default=0)
|
||||
|
||||
class Meta:
|
||||
ordering = ['-created_on']
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
Loading…
Add table
Add a link
Reference in a new issue