mirror of
https://github.com/mit-regressions/viewer.git
synced 2025-04-09 14:20:15 -04:00
20 lines
672 B
Python
20 lines
672 B
Python
from django.db import models
|
|
from django.contrib.auth.models import User
|
|
|
|
# Create your models here.
|
|
class Annotation(models.Model):
|
|
id = models.AutoField(primary_key=True)
|
|
timestamp = models.CharField(max_length=20)
|
|
contents = models.CharField(max_length=1000)
|
|
|
|
def __str__(self):
|
|
return f"{self.timestamp}"
|
|
|
|
class Comment(models.Model):
|
|
id = models.AutoField(primary_key=True)
|
|
timestamp = models.CharField(max_length=20)
|
|
contents = models.CharField(max_length=1000)
|
|
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
|
|
def __str__(self):
|
|
return f"{self.timestamp} @ {self.author}" |