Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 62b999a7fe
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (16 sloc) 0.577 kB
import datetime
from django import forms
from django_mongokit.forms import DocumentForm
from models import Talk
class TalkForm(DocumentForm):
tags = forms.CharField(max_length=250)
def clean_tags(self):
value = self.cleaned_data['tags']
return [tag.strip() for tag in value.split(',')]
def clean_when(self):
w = self.cleaned_data['when']
when = datetime.datetime(w.year, w.month, w.day, 0,0,0)
return when
class Meta:
document = Talk
fields = ['topic', 'when', 'tags', 'duration']
Jump to Line
Something went wrong with that request. Please try again.