From 4c51e5ea31e84ad75de95ed0b6b89a9d85f982cc Mon Sep 17 00:00:00 2001 From: Joel Addison Date: Mon, 24 Jun 2019 21:52:57 +1000 Subject: [PATCH] Remove LCA2019 miniconf proposal types Remove models and forms for miniconf specific proposals. --- pinaxcon/proposals/admin.py | 13 +- pinaxcon/proposals/forms.py | 98 ---------- .../migrations/0016_auto_20190624_2328.py | 81 ++++++++ pinaxcon/proposals/models.py | 185 ------------------ 4 files changed, 88 insertions(+), 289 deletions(-) create mode 100644 pinaxcon/proposals/migrations/0016_auto_20190624_2328.py diff --git a/pinaxcon/proposals/admin.py b/pinaxcon/proposals/admin.py index ed7d5942..7303d02b 100644 --- a/pinaxcon/proposals/admin.py +++ b/pinaxcon/proposals/admin.py @@ -20,12 +20,13 @@ class CategoryAdmin(admin.ModelAdmin): ] -for model in [ models.TalkProposal, models.TutorialProposal, - models.MiniconfProposal, models.SysAdminProposal, - models.KernelProposal, models.GamesProposal, - models.OpenHardwareProposal, models.OpenEdProposal, - models.DevDevProposal, models.ArtTechProposal, - models.DocsProposal, models.SecurityProposal ]: +models_to_register = [ + models.TalkProposal, + models.TutorialProposal, + models.MiniconfProposal, +] + +for model in models_to_register: admin.site.register(model, CategoryAdmin, list_display = [ "id", diff --git a/pinaxcon/proposals/forms.py b/pinaxcon/proposals/forms.py index 697ab5ce..5ada0fdb 100644 --- a/pinaxcon/proposals/forms.py +++ b/pinaxcon/proposals/forms.py @@ -4,9 +4,6 @@ from django import forms from pinaxcon.proposals.fields import HelpTextField from pinaxcon.proposals.models import TalkProposal, TutorialProposal, MiniconfProposal -from pinaxcon.proposals.models import SysAdminProposal, KernelProposal, OpenHardwareProposal -from pinaxcon.proposals.models import GamesProposal, DevDevProposal, ArtTechProposal -from pinaxcon.proposals.models import OpenEdProposal, DocsProposal, SecurityProposal DEFAULT_FIELDS = [ @@ -37,13 +34,6 @@ class ProposalForm(forms.ModelForm): return value -class DocsProposalForm(ProposalForm): - - class Meta: - model = DocsProposal - fields = TALK_FORMAT_FIELDS - - class TalkProposalForm(ProposalForm): class Meta: @@ -92,91 +82,3 @@ class MiniconfProposalForm(ProposalForm): "recording_release", "materials_release", ] - -class SysadminProposalForm(ProposalForm): - - class Meta: - model = SysAdminProposal - fields = TALK_FORMAT_FIELDS - - -class SecurityProposalForm(ProposalForm): - - class Meta: - model = SecurityProposal - fields = TALK_FORMAT_FIELDS - - -class KernelProposalForm(ProposalForm): - - class Meta: - model = KernelProposal - fields = TALK_FORMAT_FIELDS - - -class GamesProposalForm(ProposalForm): - - HELP_TEXT = ("If you have any questions please check our " - "website or contact " - "the games miniconf organisers. We're excited to hear from you! You " - "can reach us via email " - "games@lca.lonely.coffee or twitter DM " - "@ducky_tape and @the_mcjones.") - - help_field = HelpTextField(text=HELP_TEXT, label='') - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.fields['private_abstract'].help_text = ("it would be helpful if " - "you could please include a rough (don't worry, " - "we know it might change!) Outline of your presentation, e.g. " - "'0-2mins intro, 2-5mins the problem, 5-10mins things, 10-15mins " - "stuff 15-20mins solution'.") - - class Meta: - model = GamesProposal - fields = ['help_field', ] + TALK_FORMAT_FIELDS - - -class OpenHardwareProposalForm(ProposalForm): - - class Meta: - model = OpenHardwareProposal - fields = TALK_FORMAT_FIELDS - - -class OpenEdProposalForm(ProposalForm): - class Meta: - NO_TARGET_AUDIENCE_FIELDS = copy.copy(TALK_FORMAT_FIELDS) - del(NO_TARGET_AUDIENCE_FIELDS[1]) - - model = OpenEdProposal - fields = NO_TARGET_AUDIENCE_FIELDS - - -class DevDevProposalForm(ProposalForm): - - HELP_TEXT = ("The Developer Developer Miniconf is taking " - "20-minute talks only.") - - help_field = HelpTextField(text=HELP_TEXT, label='') - - class Meta: - model = DevDevProposal - fields = ['help_field', ] + DEFAULT_FIELDS - - -class ArtTechProposalForm(ProposalForm): - - class Meta: - ARTTECH_FIELDS = copy.copy(DEFAULT_FIELDS) - ARTTECH_FIELDS.remove("target_audience") - ARTTECH_FIELDS.append("talk_format") - ARTTECH_FIELDS.append("can_exhibit") - ARTTECH_FIELDS.append("exhibition_requirements") - - model = ArtTechProposal - fields = ARTTECH_FIELDS diff --git a/pinaxcon/proposals/migrations/0016_auto_20190624_2328.py b/pinaxcon/proposals/migrations/0016_auto_20190624_2328.py new file mode 100644 index 00000000..9f1b9924 --- /dev/null +++ b/pinaxcon/proposals/migrations/0016_auto_20190624_2328.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.21 on 2019-06-24 11:28 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('symposion_schedule', '0008_auto_20190122_0815'), + ('symposion_proposals', '0003_auto_20170702_2250'), + ('symposion_reviews', '0001_initial'), + ('proposals', '0015_securityproposal_talk_format'), + ] + + operations = [ + migrations.RemoveField( + model_name='arttechproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='devdevproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='docsproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='gamesproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='kernelproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='openedproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='openhardwareproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='securityproposal', + name='proposalbase_ptr', + ), + migrations.RemoveField( + model_name='sysadminproposal', + name='proposalbase_ptr', + ), + migrations.DeleteModel( + name='ArtTechProposal', + ), + migrations.DeleteModel( + name='DevDevProposal', + ), + migrations.DeleteModel( + name='DocsProposal', + ), + migrations.DeleteModel( + name='GamesProposal', + ), + migrations.DeleteModel( + name='KernelProposal', + ), + migrations.DeleteModel( + name='OpenEdProposal', + ), + migrations.DeleteModel( + name='OpenHardwareProposal', + ), + migrations.DeleteModel( + name='SecurityProposal', + ), + migrations.DeleteModel( + name='SysAdminProposal', + ), + ] diff --git a/pinaxcon/proposals/models.py b/pinaxcon/proposals/models.py index 33526507..6a985577 100644 --- a/pinaxcon/proposals/models.py +++ b/pinaxcon/proposals/models.py @@ -59,188 +59,3 @@ class MiniconfProposal(Proposal): class Meta: verbose_name = "miniconf proposal" - - -class DocsProposal(Proposal): - TALK_FORMATS = [ - (1, "Presentation (40-45 min)"), - (2, "Short Presentation (20-30 min)"), - (3, "Lightning Talk (5-10 min)") - ] - - TARGET_USER = 1 - TARGET_BUSINESS = 2 - TARGET_COMMUNITY = 3 - TARGET_DEVELOPER = 4 - TARGET_WRITER = 4 - - TARGET_AUIDENCES = [ - (TARGET_USER, "User"), - (TARGET_BUSINESS, "Business"), - (TARGET_COMMUNITY, "Community"), - (TARGET_DEVELOPER, "Developer"), - (TARGET_WRITER, "Writer"), - ] - - target_audience = models.IntegerField(choices=TARGET_AUIDENCES, default=TARGET_USER) - talk_format = models.IntegerField( - choices=TALK_FORMATS, - help_text="Please indicate your preferred talk length in the private abstract field below.") - - class Meta: - verbose_name = "Docs Down Under Miniconf Proposal" - - -class SysAdminProposal(Proposal): - - TYPE_SHORT_PRESENTATION = 1 - TYPE_LIGHTNING_TALK = 2 - - TALK_FORMATS = [ - (TYPE_SHORT_PRESENTATION, "Short Presentation (15-25 min)"), - (TYPE_LIGHTNING_TALK, "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.") - - class Meta: - verbose_name = "System Administration Miniconf Proposal" - - -class KernelProposal(Proposal): - TALK_FORMATS = [ - (1, "Presentation (40-45 min)"), - (2, "Short Presentation (20-30 min)"), - ] - - talk_format = models.IntegerField( - choices=TALK_FORMATS, - default=1, - help_text="Please indicate your preferred talk length in the private abstract field below.") - - class Meta: - verbose_name = "Kernel Miniconf Proposal" - - -class SecurityProposal(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.") - - class Meta: - verbose_name = "Security, Identity and Privacy Miniconf Proposal" - - -class GamesProposal(Proposal): - - TYPE_PRESENTATION = 1 - TYPE_SHORT_PRESENTATION = 2 - TYPE_DEMONSTRATION = 3 - TYPE_OTHER = 4 - - TALK_FORMATS = [ - (TYPE_PRESENTATION, "Presentation (long)"), - (TYPE_PRESENTATION, "Presentation (short)"), - (TYPE_DEMONSTRATION, "Demonstration"), - (TYPE_OTHER, "Other"), - ] - - talk_format = models.IntegerField(choices=TALK_FORMATS) - - class Meta: - verbose_name = "Games and FOSS Miniconf Proposal" - - -class OpenHardwareProposal(Proposal): - - TYPE_NORMAL_PRESENTATION = 1 - TYPE_LIGHTNING_TALK = 2 - - TALK_FORMATS = [ - (TYPE_NORMAL_PRESENTATION, "Presentation (20 min)"), - (TYPE_LIGHTNING_TALK, "Lightning Talk (5 min)"), - ] - - talk_format = models.IntegerField(choices=TALK_FORMATS) - - class Meta: - verbose_name = "Open Hardware Miniconf 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" - - -class DevDevProposal(Proposal): - - class Meta: - verbose_name = "Developers Developers Miniconf Proposal" - - -class ArtTechProposal(Proposal): - - TYPE_TECH = 1 - TYPE_DEMO = 2 - TYPE_LIGHTNING = 3 - - TALK_FORMATS = [ - (TYPE_TECH, "Tech talk (45 min)"), - (TYPE_DEMO, "Demonstration (20min)"), - (TYPE_LIGHTNING, "Lightning Talk (10min)"), - ] - - talk_format = models.IntegerField( - choices=TALK_FORMATS, - default=TYPE_TECH, - ) - - EXHIBIT_YES = 1 - EXHIBIT_NO = 2 - - EXHIBIT_STATUS = [ - (EXHIBIT_YES, "I am willing and able to exhibit my project on Thursday, January 24th"), - (EXHIBIT_NO, "I'm unable to exhibit my project") - ] - - can_exhibit = models.IntegerField( - choices=EXHIBIT_STATUS, - default=EXHIBIT_YES, - ) - - exhibition_requirements = models.TextField( - blank=True, - default="", - ) - - TARGET_NA = 1 - - TARGET_AUDIENCES = [ - (TARGET_NA, "N/A"), - ] - - target_audience = models.IntegerField(choices=TARGET_AUDIENCES, default=TARGET_NA) - - class Meta: - verbose_name = "Art+Tech Miniconf Proposal"