First initial commit for test Django website
This commit is contained in:
15
post/models.py
Normal file
15
post/models.py
Normal file
@ -0,0 +1,15 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
class Post(models.Model):
|
||||
title = models.CharField(max_length=75)
|
||||
body = models.TextField()
|
||||
slug = models.SlugField()
|
||||
date = models.DateTimeField(auto_now_add=True)
|
||||
banner = models.ImageField(default='fallback.png', blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user