2015-07-18 07:09:17 +00:00
|
|
|
from __future__ import unicode_literals
|
2012-07-12 04:38:24 +00:00
|
|
|
from django import forms
|
|
|
|
|
|
|
|
from symposion.speakers.models import Speaker
|
|
|
|
|
|
|
|
|
|
|
|
class SpeakerForm(forms.ModelForm):
|
2014-07-30 18:19:26 +00:00
|
|
|
|
2012-07-12 04:38:24 +00:00
|
|
|
class Meta:
|
|
|
|
model = Speaker
|
|
|
|
fields = [
|
|
|
|
"name",
|
|
|
|
"biography",
|
2016-06-19 03:19:32 +00:00
|
|
|
"experience",
|
2012-07-12 04:38:24 +00:00
|
|
|
"photo",
|
2016-06-19 03:19:32 +00:00
|
|
|
"telephone",
|
|
|
|
"homepage",
|
2016-03-15 03:24:14 +00:00
|
|
|
"twitter_username",
|
2016-06-18 03:53:02 +00:00
|
|
|
"accessibility",
|
|
|
|
"travel_assistance",
|
|
|
|
"accommodation_assistance",
|
2012-07-12 04:38:24 +00:00
|
|
|
]
|
2016-03-15 03:24:14 +00:00
|
|
|
|
|
|
|
def clean_twitter_username(self):
|
|
|
|
value = self.cleaned_data["twitter_username"]
|
|
|
|
if value.startswith("@"):
|
|
|
|
value = value[1:]
|
|
|
|
return value
|