2018-05-20 16:16:20 +00:00
|
|
|
# Generated by Django 2.0.4 on 2018-05-12 14:29
|
|
|
|
|
|
|
|
from django.db import migrations
|
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
|
2018-05-20 16:16:20 +00:00
|
|
|
def add_event_tracks(apps, schema_editor):
|
2019-06-16 12:32:24 +00:00
|
|
|
Camp = apps.get_model("camps", "Camp")
|
|
|
|
EventTrack = apps.get_model("program", "EventTrack")
|
|
|
|
EventProposal = apps.get_model("program", "EventProposal")
|
|
|
|
Event = apps.get_model("program", "Event")
|
2018-05-20 16:16:20 +00:00
|
|
|
for camp in Camp.objects.all():
|
|
|
|
# create the default track for this camp
|
2019-06-16 12:32:24 +00:00
|
|
|
track = EventTrack.objects.create(name="BornHack", slug="bornhack", camp=camp)
|
2018-05-20 16:16:20 +00:00
|
|
|
Event.objects.filter(camp=camp).update(track=track)
|
|
|
|
EventProposal.objects.filter(camp=camp).update(track=track)
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
dependencies = [("program", "0048_auto_20180512_1625")]
|
2018-05-20 16:16:20 +00:00
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
operations = [migrations.RunPython(add_event_tracks)]
|