added api/history
This commit is contained in:
parent
2aef4d4756
commit
cc5187c3a1
15 changed files with 109 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import uuid
|
||||
from django.db import models
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
class User(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
|
||||
|
|
@ -11,10 +11,10 @@ class Prediction(models.Model):
|
|||
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')
|
||||
|
||||
class UserPrediction(models.Model):
|
||||
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
|
||||
prediction = models.ForeignKey("Prediction", on_delete=models.CASCADE)
|
||||
created_at = models.DateTimeField()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue