Added submissions page.
from django import forms
from spoken_tut.upload.models import Participant
class ParticipantForm(forms.ModelForm):
def clean(self):
"""Cleaner for validating Other language field.
"""
cleaned_data = self.cleaned_data
lang = cleaned_data['language']
other_lang = cleaned_data['other_lang']
accept = cleaned_data['accept']
if lang == 'Other' and not other_lang:
raise forms.ValidationError('Please fill in the other language field.')
if accept:
raise forms.ValidationError('You need to accept the terms and condition for uploading the data.')
class Meta:
model = Participant