37051-vm/core/models.py
Flatlogic Bot bfe98de2d1 faded
2025-12-18 23:08:12 +00:00

13 lines
517 B
Python

from django.contrib.auth.models import User
from django.db import models
class Post(models.Model):
author = models.ForeignKey(User, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
slug = models.SlugField(unique=True)
content = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
intent = models.CharField(max_length=50, default='Neutral')
def __str__(self):
return f'Post by {self.author.username} on {self.created_at.strftime("%Y-%m-%d")}'