forked from AFPy/PonyConf
Add abstract and notes field to talk model and form
This commit is contained in:
parent
937208338e
commit
91240aca17
20
accounts/migrations/0007_auto_20160808_2145.py
Normal file
20
accounts/migrations/0007_auto_20160808_2145.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10 on 2016-08-08 21:45
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0006_auto_20160723_1216'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='participation',
|
||||
name='constraints',
|
||||
field=models.TextField(blank=True, verbose_name='Constraints'),
|
||||
),
|
||||
]
|
|
@ -15,7 +15,7 @@ class TalkForm(ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = Talk
|
||||
fields = ['title', 'description', 'topics', 'event', 'speakers']
|
||||
fields = ['title', 'abstract', 'description', 'topics', 'notes', 'event', 'speakers']
|
||||
widgets = {'topics': CheckboxSelectMultiple(), 'speakers': Select2TagWidget()}
|
||||
|
||||
|
||||
|
|
25
proposals/migrations/0008_auto_20160808_2145.py
Normal file
25
proposals/migrations/0008_auto_20160808_2145.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10 on 2016-08-08 21:45
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('proposals', '0007_conference'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='talk',
|
||||
name='abstract',
|
||||
field=models.CharField(blank=True, max_length=255, verbose_name='Abstract'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='talk',
|
||||
name='notes',
|
||||
field=models.TextField(blank=True, verbose_name='Notes'),
|
||||
),
|
||||
]
|
|
@ -54,8 +54,10 @@ class Talk(PonyConfModel):
|
|||
speakers = models.ManyToManyField(User, verbose_name=_('Speakers'))
|
||||
title = models.CharField(max_length=128, verbose_name=_('Title'))
|
||||
slug = AutoSlugField(populate_from='title', unique=True)
|
||||
abstract = models.CharField(max_length=255, blank=True, verbose_name=_('Abstract'))
|
||||
description = models.TextField(blank=True, verbose_name=_('Description'))
|
||||
topics = models.ManyToManyField(Topic, blank=True, verbose_name=_('Topics'))
|
||||
notes = models.TextField(blank=True, verbose_name=_('Notes'))
|
||||
event = models.IntegerField(choices=enum_to_choices(EVENTS), default=EVENTS.conference_short.value, verbose_name=_('Format'))
|
||||
accepted = models.NullBooleanField(default=None)
|
||||
|
||||
|
|
|
@ -18,11 +18,19 @@ class ProposalsTests(TestCase):
|
|||
def test_everything(self):
|
||||
# talk-edit
|
||||
self.client.login(username='a', password='a')
|
||||
self.client.post(reverse('add-talk'), {'title': 'super talk', 'description': 'super', 'event': 1, 'topics': 1,
|
||||
'speakers': 1})
|
||||
self.client.post(reverse('add-talk'),
|
||||
{'title': 'super talk',
|
||||
'abstract': 'super',
|
||||
'description': 'this is my super talk',
|
||||
'notes': 'you can watch my previous talk videos',
|
||||
'event': 1,
|
||||
'topics': 1,
|
||||
'speakers': 1})
|
||||
talk = Talk.objects.first()
|
||||
self.assertEqual(str(talk), 'super talk')
|
||||
self.assertEqual(talk.description, 'super')
|
||||
self.assertEqual(talk.abstract, 'super')
|
||||
self.assertEqual(talk.description, 'this is my super talk')
|
||||
self.assertEqual(talk.notes, 'you can watch my previous talk videos')
|
||||
self.client.post(reverse('edit-talk', kwargs={'talk': 'super-talk'}),
|
||||
{'title': 'mega talk', 'description': 'mega', 'event': 1, 'speakers': 1})
|
||||
self.assertEqual(str(talk), 'super talk') # title is read only there
|
||||
|
|
Loading…
Reference in New Issue
Block a user