OnlineJudge/announcement/models.py

19 lines
529 B
Python
Raw Permalink Normal View History

from django.db import models
from account.models import User
2015-09-22 09:03:53 +00:00
from utils.models import RichTextField
class Announcement(models.Model):
2018-05-01 04:54:27 +00:00
title = models.TextField()
2016-08-02 14:02:51 +00:00
# HTML
2015-09-22 09:03:53 +00:00
content = RichTextField()
create_time = models.DateTimeField(auto_now_add=True)
2019-03-11 03:25:10 +00:00
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
last_update_time = models.DateTimeField(auto_now=True)
visible = models.BooleanField(default=True)
class Meta:
db_table = "announcement"
2017-10-31 08:33:25 +00:00
ordering = ("-create_time",)