khaganat-web/chat/models.py

19 lines
537 B
Python
Raw Permalink Normal View History

2018-01-27 17:58:36 +00:00
from django.db import models
2018-01-27 22:12:09 +00:00
2019-07-23 13:16:03 +00:00
class LogSource(models.Model):
2018-01-27 17:58:36 +00:00
name = models.CharField(max_length=128)
slug = models.CharField(max_length=128, unique=True)
hidden = models.BooleanField(default=False)
def __str__(self):
return self.name
2019-07-23 13:16:03 +00:00
class LogEntry(models.Model):
source = models.ForeignKey(LogSource, on_delete=models.CASCADE)
2018-01-27 17:58:36 +00:00
hidden = models.BooleanField(default=False)
created = models.DateTimeField()
nick = models.CharField(max_length=128)
content = models.CharField(max_length=2048)