forked from AFPy/PonyConf
Add description field to topic.
This commit is contained in:
parent
20ecded467
commit
6311889942
|
@ -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):
|
||||
|
|
20
proposals/migrations/0006_topic_description.py
Normal file
20
proposals/migrations/0006_topic_description.py
Normal 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'),
|
||||
),
|
||||
]
|
|
@ -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'))
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user