From d9a1c04b1f56eeb6ccdf494e20a449a0e3ec9546 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 27 Dec 2022 20:06:03 -0600 Subject: sight: added the concept of recording to an event, like a walk --- app/sightings/migrations/0015_sighting_event.py | 20 ++++++++++++++++++++ app/sightings/models.py | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/sightings/migrations/0015_sighting_event.py (limited to 'app/sightings') 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) -- cgit v1.2.3-70-g09d2