Skip to content

Commit

Permalink
Merge pull request eldarion#7 from MeirKriheli/cfp-fields
Browse files Browse the repository at this point in the history
Call for proposals additional fields
  • Loading branch information
AmitAronovitch authored Mar 23, 2018
2 parents 4060293 + c8a058b commit e3875ad
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Make sure you are using a virtual environment of some sort (e.g. `virtualenv` or
npm install
pip install -r requirements.txt
./manage.py migrate
./manage.py loaddata sites conference sponsor_levels sponsor_benefits proposal_base pages
./manage.py loaddata sites conference sponsor_levels sponsor_benefits proposal_base pages audience
./manage.py sitetree_resync_apps ilpycon
./manage.py compilemessages
Expand Down
37 changes: 37 additions & 0 deletions fixtures/audience.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"model": "proposals.targetaudience",
"pk": 1,
"fields": {
"name": "Developers"
}
},
{
"model": "proposals.targetaudience",
"pk": 2,
"fields": {
"name": "Users"
}
},
{
"model": "proposals.targetaudience",
"pk": 3,
"fields": {
"name": "Integrators"
}
},
{
"model": "proposals.targetaudience",
"pk": 4,
"fields": {
"name": "System administrators"
}
},
{
"model": "proposals.targetaudience",
"pk": 5,
"fields": {
"name": "Other"
}
}
]
3 changes: 2 additions & 1 deletion ilpycon/proposals/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.contrib import admin

from .models import TalkProposal, TutorialProposal
from .models import TalkProposal, TutorialProposal, TargetAudience


admin.site.register(TargetAudience)
admin.site.register(TalkProposal)
admin.site.register(TutorialProposal)
12 changes: 12 additions & 0 deletions ilpycon/proposals/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ class Meta:
fields = [
"title",
"audience_level",
"duration",
"language",
"second_language",
"description",
"abstract",
"additional_notes",
"target_audience",
"target_audience_other",
"specific_props",
"recording_release",
]

Expand All @@ -35,8 +41,14 @@ class Meta:
fields = [
"title",
"audience_level",
"duration",
"language",
"second_language",
"description",
"abstract",
"additional_notes",
"target_audience",
"target_audience_other",
"specific_props",
"recording_release",
]
85 changes: 85 additions & 0 deletions ilpycon/proposals/migrations/0002_auto_20180316_0924.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Generated by Django 2.0.1 on 2018-03-16 09:24

import datetime
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('proposals', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='TargetAudience',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
],
options={
'verbose_name': 'Target Audience',
'verbose_name_plural': 'Target Audiences',
},
),
migrations.AddField(
model_name='talkproposal',
name='duration',
field=models.DurationField(choices=[(datetime.timedelta(0, 1500), 'Standard 25 minutes talk.'), (datetime.timedelta(0, 2400), 'Long 40 minutes talk.'), (datetime.timedelta(0, 12600), 'Half day workshop/sprint (3.5 hours net).'), (datetime.timedelta(0, 25200), 'Full day workshop/sprint (7 hours net).')], default=datetime.timedelta(0, 1500), verbose_name='Session Duration'),
),
migrations.AddField(
model_name='talkproposal',
name='language',
field=models.CharField(choices=[('en', 'English'), ('he', 'Hebrew')], default='en', max_length=5, verbose_name='Proposal Language'),
),
migrations.AddField(
model_name='talkproposal',
name='second_language',
field=models.CharField(blank=True, choices=[('en', 'English'), ('he', 'Hebrew')], max_length=5, verbose_name='Propsal Lanugauge - 2nd choice'),
),
migrations.AddField(
model_name='talkproposal',
name='specific_props',
field=models.CharField(blank=True, help_text='Any Specific Props Needed?', max_length=200, verbose_name='Specific Props'),
),
migrations.AddField(
model_name='talkproposal',
name='target_audience_other',
field=models.CharField(blank=True, max_length=200, verbose_name='Other target audience'),
),
migrations.AddField(
model_name='tutorialproposal',
name='duration',
field=models.DurationField(choices=[(datetime.timedelta(0, 1500), 'Standard 25 minutes talk.'), (datetime.timedelta(0, 2400), 'Long 40 minutes talk.'), (datetime.timedelta(0, 12600), 'Half day workshop/sprint (3.5 hours net).'), (datetime.timedelta(0, 25200), 'Full day workshop/sprint (7 hours net).')], default=datetime.timedelta(0, 1500), verbose_name='Session Duration'),
),
migrations.AddField(
model_name='tutorialproposal',
name='language',
field=models.CharField(choices=[('en', 'English'), ('he', 'Hebrew')], default='en', max_length=5, verbose_name='Proposal Language'),
),
migrations.AddField(
model_name='tutorialproposal',
name='second_language',
field=models.CharField(blank=True, choices=[('en', 'English'), ('he', 'Hebrew')], max_length=5, verbose_name='Propsal Lanugauge - 2nd choice'),
),
migrations.AddField(
model_name='tutorialproposal',
name='specific_props',
field=models.CharField(blank=True, help_text='Any Specific Props Needed?', max_length=200, verbose_name='Specific Props'),
),
migrations.AddField(
model_name='tutorialproposal',
name='target_audience_other',
field=models.CharField(blank=True, max_length=200, verbose_name='Other target audience'),
),
migrations.AddField(
model_name='talkproposal',
name='target_audience',
field=models.ManyToManyField(related_name='talkproposals', to='proposals.TargetAudience', verbose_name='Target Audience'),
),
migrations.AddField(
model_name='tutorialproposal',
name='target_audience',
field=models.ManyToManyField(related_name='tutorialproposals', to='proposals.TargetAudience', verbose_name='Target Audience'),
),
]
48 changes: 46 additions & 2 deletions ilpycon/proposals/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
from datetime import timedelta

from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from ilpycon.symposion.proposals.models import ProposalBase


class TargetAudience(models.Model):

name = models.CharField(max_length=30)

class Meta:
verbose_name = _('Target Audience')
verbose_name_plural = _('Target Audiences')

def __str__(self):
return self.name


class Proposal(ProposalBase):

AUDIENCE_LEVEL_NOVICE = 1
Expand All @@ -15,12 +31,40 @@ class Proposal(ProposalBase):
(AUDIENCE_LEVEL_EXPERIENCED, "Experienced"),
]

DURATION_CHOICES = (
(timedelta(minutes=25), _('Standard 25 minutes talk.')),
(timedelta(minutes=40), _('Long 40 minutes talk.')),
(timedelta(hours=3.5), _('Half day workshop/sprint (3.5 hours net).')),
(timedelta(hours=7), _('Full day workshop/sprint (7 hours net).')),
)

audience_level = models.IntegerField(choices=AUDIENCE_LEVELS)
duration = models.DurationField(choices=DURATION_CHOICES,
default=DURATION_CHOICES[0][0],
verbose_name=_('Session Duration'))

language = models.CharField(max_length=5, choices=settings.LANGUAGES,
default=settings.LANGUAGES[0][0],
verbose_name=_('Proposal Language'))
second_language = models.CharField(
max_length=5, choices=settings.LANGUAGES, blank=True,
verbose_name=_('Propsal Lanugauge - 2nd choice'))
recording_release = models.BooleanField(
default=True,
help_text="By submitting your proposal, you agree to give permission to the conference organizers to record, edit, and release audio and/or video of your presentation. If you do not agree to this, please uncheck this box."
)
help_text=_("By submitting your proposal, you agree to give permission "
"to the conference organizers to record, edit, and release "
"audio and/or video of your presentation. If you do not "
"agree to this, please uncheck this box."))

target_audience = models.ManyToManyField(TargetAudience,
related_name='%(class)ss',
verbose_name=_('Target Audience'))
target_audience_other = models.CharField(
max_length=200, blank=True, verbose_name=_('Other target audience'))

specific_props = models.CharField(
max_length=200, blank=True, verbose_name=_('Specific Props'),
help_text=_('Any Specific Props Needed?'))

class Meta:
abstract = True
Expand Down
23 changes: 23 additions & 0 deletions ilpycon/symposion/speakers/migrations/0002_auto_20180316_0809.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.0.1 on 2018-03-16 08:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('symposion_speakers', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='speaker',
name='financial_assistance',
field=models.BooleanField(default=False, verbose_name='Financial Assistance Needed?'),
),
migrations.AddField(
model_name='speaker',
name='phone_number',
field=models.CharField(blank=True, max_length=20, null=True, verbose_name='Contact Phone number'),
),
]
4 changes: 4 additions & 0 deletions ilpycon/symposion/speakers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class Speaker(models.Model):
name = models.CharField(verbose_name=_("Name"), max_length=100,
help_text=_("As you would like it to appear in the"
" conference program."))
phone_number = models.CharField(max_length=20, null=True, blank=True,
verbose_name=_("Contact Phone number"))
financial_assistance = models.BooleanField(
default=False, verbose_name=_("Financial Assistance Needed?"))
biography = models.TextField(blank=True, help_text=_("A little bit about you. Edit using "
"<a href='http://warpedvisions.org/projects/"
"markdown-cheat-sheet/target='_blank'>"
Expand Down

0 comments on commit e3875ad

Please sign in to comment.