class VerifyForm(forms.Form): other_name = forms.CharField(max_length=200, label="First Name(s)") surname = forms.CharField(max_length=200) alternative_email = forms.EmailField(required=False, label="Your primary email address") organization = forms.CharField(required=False, label="Organization, Hostpital or Company") layout = Layout(Row('other_name', 'surname'), 'alternative_email', 'organization') def clean(self): cleaned_data = super(VerifyForm, self).clean() other_name = cleaned_data.get("other_name") surname = cleaned_data.get("surname") try: Medic.objects.get(surname__iexact=surname, other_name__iexact=other_name) pass except Medic.DoesNotExist: raise forms.ValidationError( "%s %s does not exist in our database. Please provide your registered name as " "they appear on your medical license" % (other_name, surname)) # except Medic.objects.get(surname__iexact=surname, other_name__iexact=other_name, invitation_status=True, # verification_status=True): # raise forms.ValidationError("%s %s was already invited to join 360MedNet. Please check your email for " # "the invitation." % (other_name, surname)) return self.cleaned_data
class BidForm(forms.Form): username = forms.CharField() email = forms.EmailField(label="Email Address") password = forms.CharField(widget=forms.PasswordInput) password_confirm = forms.CharField(widget=forms.PasswordInput, label="Confirm password") first_name = forms.CharField(required=False) last_name = forms.CharField(required=False) gender = forms.ChoiceField(choices=((None, ''), ('F', 'Female'), ('M', 'Male'), ('O', 'Other'))) receive_news = forms.BooleanField(required=False, label='I want to receive news and special offers') agree_toc = forms.BooleanField(required=True, label='I agree with the Terms and Conditions') layout = Layout('username', 'email', Row('password', 'password_confirm'), Fieldset('Pesonal details', Row('first_name', 'last_name'), 'gender', 'receive_news', 'agree_toc'))
class DoctorForm(forms.ModelForm): layout = Layout( Fieldset('Personal details', Row('first_name', 'last_name'), 'profession', 'specialization', 'country')) class Meta: model = Doctor fields = ('first_name', 'last_name', 'profession', 'specialization', 'country')
class ProfileForm(forms.ModelForm): layout = Layout(Fieldset('Personal details', Row('first_name', 'middle_name', 'last_name'), Row('gender', 'date_of_birth'), 'about_me', 'mobile_number', ), Fieldset('Professional details', Row('profession', 'specialization'), Row('year_of_first_medical_certification', 'hospital'), Row('country', 'city'), 'work_number', ), 'avatar' ) class Meta: model = Doctor fields = ('first_name', 'middle_name', 'last_name', 'gender', 'date_of_birth', 'profession', 'specialization', 'country', 'city', 'year_of_first_medical_certification', 'mobile_number', 'about_me', 'hospital', 'work_number', 'avatar')
class UserForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput()) username = forms.CharField(help_text=False) email = forms.EmailField(label="Email Address") layout = Layout(Row('email', 'username', 'password')) class Meta: model = User fields = ('username', 'email', 'password')
class DoctorForm(forms.ModelForm): country = forms.CharField(label="Country of Practice") layout = Layout(Fieldset('Personal details', Row('first_name', 'last_name'), 'profession', 'specialization', 'country' )) class Meta: model = Doctor fields = ('first_name', 'last_name', 'profession', 'specialization', 'country')
class RegistrationForm1(forms.ModelForm): invitation_code = forms.CharField(max_length=6, validators=[invitation_code_exists]) layout = Layout(Row( 'first_name', 'last_name', ), 'invitation_code') class Meta: model = Doctor fields = ('first_name', 'last_name', 'invitation_code')
class VerifyForm(forms.Form): other_name = forms.CharField(required=False, label="First Name(s)") surname = forms.CharField(required=False) email = forms.EmailField(required=False, label="Email Address") alternative_email = forms.EmailField(required=False, label="Alternative Email Address") layout = Layout( Row('other_name', 'surname'), 'email', 'alternative_email' )
class UserForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput()) email = forms.EmailField(label="Email Address") layout = Layout(Row('email', 'password')) class Meta: model = User fields = ('username', 'email', 'password') def __init__(self, *args, **kwargs): super(UserForm, self).__init__(*args, **kwargs)
class UserForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput, label='Hasło') confirm_password = forms.CharField(widget=forms.PasswordInput, label='Powtórz hasło', required=False) layout = Layout('username', 'email', Row('password', 'confirm_password')) class Meta: model = Profile fields = ('username', 'email') def clean_confirm_password(self): cd = self.cleaned_data if cd['password'] != cd['confirm_password']: raise forms.ValidationError('Hasła nie są identyczne') return cd['confirm_password']
class MedicalCaseForm(forms.ModelForm): layout = Layout( 'title', 'chief_complaint', Fieldset( 'Patient details', Row('patient_age', 'patient_gender', 'patient_country_of_origin'), 'history_of_present_illness', 'medical_history', 'surgical_history', 'social_history', 'family_history', 'allergies', 'medications', 'review_of_systems', 'physical_examination', 'diagnostic_tests', 'any_other_details', 'medical_case_category'), 'purpose') class Meta: model = MedicalCase fields = ('title', 'chief_complaint', 'patient_age', 'patient_gender', 'patient_country_of_origin', 'history_of_present_illness', 'medical_history', 'surgical_history', 'social_history', 'family_history', 'allergies', 'medications', 'review_of_systems', 'physical_examination', 'diagnostic_tests', 'any_other_details', 'medical_case_category', 'purpose')
class ProjectUpdateView(LayoutMixin, UpdateView): layout = Layout( Row('company'), Row('one_liner'), Row('product_narrative'), Row(Span6('semester'), Span6('tags')), Row('members'), Row('team_photo'), ) model = Project success_url = reverse_lazy('accounts:user-profile') fields = [ "company", "one_liner", "product_narrative", "semester", "tags", "members", "team_photo" ] template_name_suffix = '_update_form'