diff --git a/doc/requirements.md b/doc/requirements.md index 4102c94..195eddb 100644 --- a/doc/requirements.md +++ b/doc/requirements.md @@ -1,6 +1,6 @@ - [x] enregistrement sur le site (pas d'enregistrement fb/linkedin: on aime le libre ici) -- [ ] permettre de proposer une participation (conférence/atelier/small talk/etc.). Un speaker rentre un abstract et - peur associer un ou des co-speakers. +- [x] permettre de proposer une participation (conférence/atelier/small talk/etc.). +- [ ] Un speaker rentre un abstract et peut associer un ou des co-speakers. - [ ] l'équipe organisatrice peut voter pour les conférences (avec un commentaire visible uniquement de l'équipe) et les accepter/refuser - [ ] pour chaque conférence/conférencier, on permet d'échanger avec le conférencier (lui vois ça comme un mail, mais diff --git a/proposals/forms.py b/proposals/forms.py index 07eeacd..c83a877 100644 --- a/proposals/forms.py +++ b/proposals/forms.py @@ -5,4 +5,4 @@ from proposals.models import Talk __all__ = ['TalkForm'] -TalkForm = modelform_factory(Talk, fields=['title', 'description', 'topics']) +TalkForm = modelform_factory(Talk, fields=['title', 'description', 'topics', 'event']) diff --git a/proposals/migrations/0002_talk_event.py b/proposals/migrations/0002_talk_event.py new file mode 100644 index 0000000..9bf800f --- /dev/null +++ b/proposals/migrations/0002_talk_event.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-06-12 20:26 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('proposals', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='talk', + name='event', + field=models.IntegerField(choices=[(1, 'conference'), (2, 'workshop'), (3, 'stand'), (4, 'other')], default=1), + ), + ] diff --git a/proposals/models.py b/proposals/models.py index 634e078..ddab9d3 100644 --- a/proposals/models.py +++ b/proposals/models.py @@ -1,3 +1,5 @@ +from enum import IntEnum + from django.contrib.auth.models import User from django.contrib.sites.managers import CurrentSiteManager from django.contrib.sites.models import Site @@ -6,6 +8,8 @@ from django.db import models from autoslug import AutoSlugField +from accounts.models import enum_to_choices + __all__ = ['Topic', 'Talk', 'Speach'] @@ -23,6 +27,8 @@ class Topic(models.Model): class Talk(models.Model): + EVENTS = IntEnum('Event', 'conference workshop stand other') + site = models.ForeignKey(Site, on_delete=models.CASCADE) speakers = models.ManyToManyField(User, through='Speach') @@ -30,6 +36,7 @@ class Talk(models.Model): slug = AutoSlugField(populate_from='title', unique=True) description = models.TextField(blank=True, verbose_name='Description') topics = models.ManyToManyField(Topic, blank=True) + event = models.IntegerField(choices=enum_to_choices(EVENTS), default=EVENTS.conference.value) objects = models.Manager() on_site = CurrentSiteManager() diff --git a/proposals/templates/proposals/_talk_list.html b/proposals/templates/proposals/_talk_list.html new file mode 100644 index 0000000..9fcf6ca --- /dev/null +++ b/proposals/templates/proposals/_talk_list.html @@ -0,0 +1,18 @@ +
{{ talk.get_event_display }}
+ Description:{{ talk.description }}
diff --git a/proposals/templates/proposals/talk_list.html b/proposals/templates/proposals/talk_list.html index 7ed87c4..e00cd0c 100644 --- a/proposals/templates/proposals/talk_list.html +++ b/proposals/templates/proposals/talk_list.html @@ -6,19 +6,6 @@