Add text field to KaehmyForm

This commit is contained in:
Jan Tuomi
2017-10-11 18:45:28 +03:00
parent bd45742953
commit c36f227bf0
2 changed files with 23 additions and 2 deletions
+20
View File
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-10-11 15:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0016_auto_20171011_1828'),
]
operations = [
migrations.AddField(
model_name='kaehmyform',
name='text',
field=models.TextField(default='', max_length=300, verbose_name='Text'),
),
]
+3 -2
View File
@@ -92,7 +92,7 @@ class BaseRole(models.Model):
is_board = models.BooleanField(_('Board member'))
def __str__(self):
return self.name.capitalize()
return '{} ({})'.format(self.name.capitalize(), _('board member'))
class PresetRole(BaseRole):
@@ -143,11 +143,12 @@ class KaehmyForm(MessageParent):
name = models.CharField(_('Name'), max_length=255)
email = models.EmailField(_('Email'))
year = models.IntegerField(_('Year'))
text = models.TextField(_('Text'), default="", max_length=300)
custom_roles = models.ManyToManyField('CustomKaehmyRole', related_name='forms', blank=True)
preset_roles = models.ManyToManyField('PresetKaehmyRole', related_name='forms', blank=True)
def __str__(self):
return _('Hakemus: {}').format(self.name)
return _('Kaehmy application: {}').format(self.name)
class Role(PresetRole):