Skip to content

Commit

Permalink
Merge pull request #361 from City-of-Turku/feature/exception-situatio…
Browse files Browse the repository at this point in the history
…n-location-can-be-in-multiple-announcements

Feature/exceptional situation situation can be in multiple announcements
  • Loading branch information
juuso-j authored Jun 24, 2024
2 parents b9d8536 + 5dcea0c commit 8e9787f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.1.13 on 2024-06-20 07:37

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("exceptional_situations", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name="situationannouncement",
name="location",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="announcements",
to="exceptional_situations.situationlocation",
),
),
]
4 changes: 2 additions & 2 deletions exceptional_situations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class SituationAnnouncement(models.Model):
start_time = models.DateTimeField()
end_time = models.DateTimeField(null=True, blank=True)
additional_info = models.JSONField(null=True, blank=True)
location = models.OneToOneField(
location = models.ForeignKey(
SituationLocation,
on_delete=models.CASCADE,
null=True,
blank=True,
related_name="announcement",
related_name="announcements",
)

class Meta:
Expand Down

0 comments on commit 8e9787f

Please sign in to comment.