first commit
This commit is contained in:
parent
6bdba48fa5
commit
7f28fe580d
38 changed files with 452 additions and 0 deletions
20
api/models.py
Normal file
20
api/models.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import uuid
|
||||
from django.db import models
|
||||
|
||||
class User(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
|
||||
class Prediction(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
result = models.JSONField()
|
||||
deleted_at = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
class UserPrediction(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
prediction = models.ForeignKey(Prediction, on_delete=models.CASCADE)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('user', 'prediction')
|
||||
Loading…
Add table
Add a link
Reference in a new issue