Skip to content

Commit

Permalink
Provide default times for event
Browse files Browse the repository at this point in the history
  • Loading branch information
Almad committed Oct 1, 2010
1 parent 93cd8b7 commit b5778e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rpgscheduler/convention/forms.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta

from django.forms import (
Form, ValidationError,
Expand All @@ -8,8 +9,8 @@

class EventForm(Form):
title = CharField(label=u"Název", max_length=255)
start = DateTimeField(label=u"Začátek", input_formats='%Y-%m-%d %H:%M')
end = DateTimeField(label=u"Konec", input_formats='%Y-%m-%d %H:%M')
start = DateTimeField(label=u"Začátek", input_formats='%Y-%m-%d %H:%M', initial=datetime.now)
end = DateTimeField(label=u"Konec", input_formats='%Y-%m-%d %H:%M', initial=lambda:datetime.now()+timedelta(hours=1))
description = CharField(label=u"Popis", widget=Textarea(), initial=u"""
== Popis akce ==
Expand Down

0 comments on commit b5778e2

Please sign in to comment.