initial drf project setup
This commit is contained in:
13
journal/models.py
Normal file
13
journal/models.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
||||
|
||||
class Post(models.Model):
|
||||
title = models.CharField(max_length=255)
|
||||
content = models.TextField()
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
modified = models.DateTimeField(auto_now=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.title} ({self.content[0:255]}{"..." if len(self.content) > 255 else ""})"
|
||||
Reference in New Issue
Block a user