Skip to content

Commit

Permalink
Situation can have multiple announcemounts
Browse files Browse the repository at this point in the history
  • Loading branch information
juuso-j committed Jun 20, 2024
1 parent b9d8536 commit 5dcea0c
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 5dcea0c

Please sign in to comment.