renamed fbf app to bird
This commit is contained in:
parent
7724148dfc
commit
2d75a02c6e
19 changed files with 12 additions and 13 deletions
30
bird/models.py
Normal file
30
bird/models.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from uuid import uuid4
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
from rescuer.models import Rescuer
|
||||
|
||||
|
||||
class FallenBird(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
||||
bird = models.ForeignKey("Bird", on_delete=models.CASCADE)
|
||||
date_found = models.DateField()
|
||||
place = models.CharField(max_length=256)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
updated = models.DateTimeField(auto_now=True)
|
||||
rescuer = models.ForeignKey(Rescuer, on_delete=models.CASCADE)
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return self.place
|
||||
|
||||
|
||||
class Bird(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
||||
name = models.CharField(max_length=256)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
Loading…
Add table
Add a link
Reference in a new issue