Skip to content
Snippets Groups Projects
Commit cead814c authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

set default duration in AK Submission

add default slot size to Event model
set initial form value to event deafult slot size
parent 6ccebcb5
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.2.6 on 2019-10-25 13:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AKModel', '0022_remove_akowner_email'),
]
operations = [
migrations.AddField(
model_name='event',
name='default_slot',
field=models.DecimalField(decimal_places=2, default=2,
help_text='Default length in hours that is assumed for AKs in this event.',
max_digits=4, verbose_name='Default Slot Length'),
),
]
......@@ -20,6 +20,8 @@ class Event(models.Model):
active = models.BooleanField(verbose_name=_('Active State'), help_text=_('Marks currently active events'))
base_url = models.URLField(verbose_name=_("Base URL"), help_text=_("Prefix for wiki link construction"), blank=True)
default_slot = models.DecimalField(max_digits=4, decimal_places=2, default=2, verbose_name='Default Slot Length',
help_text='Default length in hours that is assumed for AKs in this event.')
class Meta:
verbose_name = _('Event')
......@@ -92,7 +94,8 @@ class AKCategory(models.Model):
"""
name = models.CharField(max_length=64, unique=True, verbose_name=_('Name'), help_text=_('Name of the AK Category'))
color = models.CharField(max_length=7, blank=True, verbose_name=_('Color'), help_text=_('Color for displaying'))
description = models.TextField(blank=True, verbose_name=_("Description"), help_text=_("Short description of this AK Category"))
description = models.TextField(blank=True, verbose_name=_("Description"),
help_text=_("Short description of this AK Category"))
class Meta:
verbose_name = _('AK Category')
......
......@@ -108,7 +108,9 @@ class AKSubmissionForm(AKForm):
widget=forms.Textarea,
label=_("Duration(s)"),
help_text=_(
"Enter at least one planned duration (in hours). If your AK should have multiple slots, use multiple lines")
"Enter at least one planned duration (in hours). If your AK should have multiple slots, use multiple lines"),
initial=
self.initial.get('event').default_slot
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment