symposion_app/symposion/speakers/forms.py
2016-06-18 13:53:02 +10:00

26 lines
624 B
Python

from __future__ import unicode_literals
from django import forms
from symposion.speakers.models import Speaker
class SpeakerForm(forms.ModelForm):
class Meta:
model = Speaker
fields = [
"name",
"biography",
"photo",
"twitter_username",
"experience",
"accessibility",
"travel_assistance",
"accommodation_assistance",
]
def clean_twitter_username(self):
value = self.cleaned_data["twitter_username"]
if value.startswith("@"):
value = value[1:]
return value