unfinished logging
This commit is contained in:
parent
94501bf986
commit
43ccf7fb34
10 changed files with 117 additions and 50 deletions
|
|
@ -1,10 +1,14 @@
|
|||
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)
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
class User(AbstractUser):
|
||||
satellites = models.ManyToManyField("Satellite", related_name="users")
|
||||
|
||||
|
||||
class Prediction(models.Model):
|
||||
satellite = models.ForeignKey('Satellite', on_delete=models.CASCADE, related_name='predictions', null=True)
|
||||
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)
|
||||
|
|
@ -12,7 +16,6 @@ class Prediction(models.Model):
|
|||
deleted_at = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
|
||||
|
||||
class UserPrediction(models.Model):
|
||||
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
|
||||
prediction = models.ForeignKey("Prediction", on_delete=models.CASCADE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue