From 6744ee19598dd79d1771ce9e07c50ffe3b1864d7 Mon Sep 17 00:00:00 2001 From: Stephan Telling Date: Sun, 9 Jul 2017 21:24:25 +0200 Subject: [PATCH] add field to allow video recording on event proposal --- ...040_eventproposal_allow_video_recording.py | 20 +++++++++++++++++++ src/program/models.py | 6 ++++++ src/program/views.py | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/program/migrations/0040_eventproposal_allow_video_recording.py diff --git a/src/program/migrations/0040_eventproposal_allow_video_recording.py b/src/program/migrations/0040_eventproposal_allow_video_recording.py new file mode 100644 index 00000000..805f65f8 --- /dev/null +++ b/src/program/migrations/0040_eventproposal_allow_video_recording.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-07-09 19:12 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0039_auto_20170430_1408'), + ] + + operations = [ + migrations.AddField( + model_name='eventproposal', + name='allow_video_recording', + field=models.BooleanField(default=False, help_text='If we can video record the event or not'), + ), + ] diff --git a/src/program/models.py b/src/program/models.py index ee69e63f..35ddeb79 100644 --- a/src/program/models.py +++ b/src/program/models.py @@ -230,6 +230,11 @@ class EventProposal(UserSubmittedModel): help_text='Pick the speaker(s) for this event', ) + allow_video_recording = models.BooleanField( + default=False, + help_text='If we can video record the event or not' + ) + @property def headline(self): return self.title @@ -249,6 +254,7 @@ class EventProposal(UserSubmittedModel): event.abstract = self.abstract event.event_type = self.event_type event.proposal = self + event.video_recording = self.video_recording event.save() # loop through the speakerproposals linked to this eventproposal and associate any related speaker objects with this event for sp in self.speakers.all(): diff --git a/src/program/views.py b/src/program/views.py index 1e4c6c50..f1e5becd 100644 --- a/src/program/views.py +++ b/src/program/views.py @@ -139,7 +139,7 @@ class SpeakerProposalPictureView(LoginRequiredMixin, CampViewMixin, EnsureUserOw class EventProposalCreateView(LoginRequiredMixin, CampViewMixin, CreateProposalMixin, EnsureWritableCampMixin, EnsureCFSOpenMixin, CreateView): model = models.EventProposal - fields = ['title', 'abstract', 'event_type', 'speakers'] + fields = ['title', 'abstract', 'event_type', 'speakers', 'allow_video_recording'] template_name = 'eventproposal_form.html' def get_context_data(self, **kwargs):