From d49aeefc176137460dd1aa120b7883893d9d3732 Mon Sep 17 00:00:00 2001 From: Tobias Date: Tue, 23 Oct 2018 21:15:08 +1300 Subject: [PATCH] Add OpenEd fields --- pinaxcon/proposals/forms.py | 6 +++-- .../migrations/0013_auto_20181023_1914.py | 26 +++++++++++++++++++ pinaxcon/proposals/models.py | 12 +++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 pinaxcon/proposals/migrations/0013_auto_20181023_1914.py diff --git a/pinaxcon/proposals/forms.py b/pinaxcon/proposals/forms.py index db49482d..b880b3b9 100644 --- a/pinaxcon/proposals/forms.py +++ b/pinaxcon/proposals/forms.py @@ -141,10 +141,12 @@ class OpenHardwareProposalForm(ProposalForm): class OpenEdProposalForm(ProposalForm): - class Meta: + NO_TARGET_AUDIENCE_FIELDS = copy.copy(TALK_FORMAT_FIELDS) + del(NO_TARGET_AUDIENCE_FIELDS[1]) + model = OpenEdProposal - fields = DEFAULT_FIELDS + fields = NO_TARGET_AUDIENCE_FIELDS class DevDevProposalForm(ProposalForm): diff --git a/pinaxcon/proposals/migrations/0013_auto_20181023_1914.py b/pinaxcon/proposals/migrations/0013_auto_20181023_1914.py new file mode 100644 index 00000000..143737b1 --- /dev/null +++ b/pinaxcon/proposals/migrations/0013_auto_20181023_1914.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.15 on 2018-10-23 08:14 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('proposals', '0012_auto_20181018_1830'), + ] + + operations = [ + migrations.AddField( + model_name='openedproposal', + name='talk_format', + field=models.IntegerField(choices=[(1, 'Presentation (40-45 min)'), (2, 'Short Presentation (20-30 min)'), (3, 'Lightning Talk (5-10 min)')], default=1, help_text='Please indicate your preferred talk length in the private abstract field below.'), + preserve_default=False, + ), + migrations.AlterField( + model_name='openedproposal', + name='target_audience', + field=models.IntegerField(blank=True, null=True), + ), + ] diff --git a/pinaxcon/proposals/models.py b/pinaxcon/proposals/models.py index 42ad1096..c203a709 100644 --- a/pinaxcon/proposals/models.py +++ b/pinaxcon/proposals/models.py @@ -161,6 +161,18 @@ class OpenHardwareProposal(Proposal): class OpenEdProposal(Proposal): + TALK_FORMATS = [ + (1, "Presentation (40-45 min)"), + (2, "Short Presentation (20-30 min)"), + (3, "Lightning Talk (5-10 min)") + ] + + talk_format = models.IntegerField( + choices=TALK_FORMATS, + help_text="Please indicate your preferred talk length in the private abstract field below.") + + # Can't delete an inherited field + target_audience = models.IntegerField(blank=True, null=True) class Meta: verbose_name = "Open Education Miniconf Proposal"