summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/sightings/migrations/0015_sighting_event.py20
-rw-r--r--app/sightings/models.py3
2 files changed, 22 insertions, 1 deletions
diff --git a/app/sightings/migrations/0015_sighting_event.py b/app/sightings/migrations/0015_sighting_event.py
new file mode 100644
index 0000000..8b35f6e
--- /dev/null
+++ b/app/sightings/migrations/0015_sighting_event.py
@@ -0,0 +1,20 @@
+# Generated by Django 4.1.3 on 2022-12-27 21:05
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('locations', '0028_auto_20200308_1152'),
+ ('sightings', '0014_rename_image_ap_featured_image'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='sighting',
+ name='event',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='locations.track'),
+ ),
+ ]
diff --git a/app/sightings/models.py b/app/sightings/models.py
index 93de8d8..dfcde2c 100644
--- a/app/sightings/models.py
+++ b/app/sightings/models.py
@@ -11,7 +11,7 @@ from django.conf import settings
from bs4 import BeautifulSoup
-from locations.models import Location
+from locations.models import Location, Track
from media.models import LuxImage, LuxImageSize
from utils.next_prev import next_in_order, prev_in_order
@@ -139,6 +139,7 @@ class Sighting(models.Model):
country_slug = models.CharField(max_length=200, blank=True)
region_name = models.CharField(max_length=200, blank=True)
ap_common_name = models.CharField(max_length=200, blank=True)
+ event = models.ForeignKey(Track, on_delete=models.SET_NULL, blank=True, null=True)
# seen_by = models.ManyToManyField(User)
# images = models.ManyToManyField(LuxImage, blank=True)
# audio = models.ManyToManyField(BirdAudio, blank=True)