Merge pull request #11 from toulibre/topicdescription

Add description field to topic.
This commit is contained in:
Lionel Porcheron 2016-08-07 11:34:03 +02:00 committed by GitHub
commit 49b701c42b
4 changed files with 23 additions and 2 deletions

View File

@ -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):

View File

@ -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'),
),
]

View File

@ -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'))

View File

@ -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()