diff --git a/proposals/forms.py b/proposals/forms.py index 285238f..7cad150 100644 --- a/proposals/forms.py +++ b/proposals/forms.py @@ -26,7 +26,7 @@ class TopicCreateForm(ModelForm): class Meta: model = Topic - fields = ['name', 'reviewers'] + fields = ['name', 'description', 'reviewers'] widgets = {'reviewers': Select2TagWidget()} def clean_name(self): diff --git a/proposals/migrations/0006_topic_description.py b/proposals/migrations/0006_topic_description.py new file mode 100644 index 0000000..5542d7a --- /dev/null +++ b/proposals/migrations/0006_topic_description.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10 on 2016-08-07 07:50 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('proposals', '0005_auto_20160723_1216'), + ] + + operations = [ + migrations.AddField( + model_name='topic', + name='description', + field=models.TextField(blank=True, verbose_name='Description'), + ), + ] diff --git a/proposals/models.py b/proposals/models.py index c4fd0b7..ac9da53 100644 --- a/proposals/models.py +++ b/proposals/models.py @@ -21,6 +21,7 @@ class Topic(PonyConfModel): name = models.CharField(max_length=128, verbose_name=_('Name')) slug = AutoSlugField(populate_from='name', unique=True) + description = models.TextField(blank=True, verbose_name=_('Description')) reviewers = models.ManyToManyField(User, blank=True, verbose_name=_('Reviewers')) diff --git a/proposals/tests.py b/proposals/tests.py index 82c1c4a..5687b8c 100644 --- a/proposals/tests.py +++ b/proposals/tests.py @@ -11,7 +11,7 @@ from .models import Talk, Topic, Vote class ProposalsTests(TestCase): def setUp(self): a, b, c = (User.objects.create_user(guy, email='%s@example.org' % guy, password=guy) for guy in 'abc') - Topic.objects.create(name='topipo', site=Site.objects.first()) + Topic.objects.create(name='topipo', description='super topic', site=Site.objects.first()) c.is_superuser = True c.save()