Created
April 16, 2009 04:43
-
-
Save fitoria/96221 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.forms import ModelForm | |
| from django import forms | |
| from models import PAISES, COMUNIDADES, UserProfile | |
| FORMATOS_FECHA = ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%m/%d/%Y', '%d/%m/%y', '%d/%m/%Y') | |
| class ProfileForm(ModelForm): | |
| edad = forms.IntegerField() | |
| telefono = forms.CharField() | |
| pais = forms.ChoiceField(choices = PAISES) | |
| gul = forms.ChoiceField(choices = COMUNIDADES) | |
| website = forms.URLField(required = False) | |
| avatar=forms.ImageField(required=False) | |
| comentario=forms.CharField(widget=forms.widgets.Textarea) | |
| forma_llegada=forms.ChoiceField(choices = ((1, 'Aerea'), (2, 'Terrestre'), (3, 'Otro'))) | |
| fecha_llegada=forms.DateField(required=False, input_formats=FORMATOS_FECHA, | |
| help_text='Formatos permitidos dd/mm/yy, aa/mm/dd, mm/dd/yy, mm/dd/yyyy') | |
| hora_llegada=forms.TimeField(required=False, help_text='Formato de 24 horas HH:MM hora local de Nicaragua(GTM -6)') | |
| fecha_salida=forms.DateField(required=False, input_formats=FORMATOS_FECHA, | |
| help_text='Formatos permitidos dd/mm/yy, aa/mm/dd, mm/dd/yy, mm/dd/yyyy') | |
| hora_salida=forms.TimeField(required=False, help_text='Formato de 24 horas HH:MM hora local de Nicaragua(GTM -6)') | |
| id_llegada=forms.CharField(help_text="Numero de vuelo y areolinea o empresa de bus", | |
| label="Identificador de llegada", required=False) | |
| talla=forms.ChoiceField(label='Talla de camiseta',choices=(('S','S' ),('M','M' ), | |
| ('L','L'), ('XL', 'XL'), ('XXL', 'XXL' ), ('XXXL', 'XXXL'))) | |
| computadora=forms.BooleanField(label='Trae computadora?', required=False) | |
| enfermedad=forms.BooleanField(label='Posee alguna enfermedad?', required=False) | |
| tipo_enfermedad=forms.CharField(required=False) | |
| alergia=forms.BooleanField(label='Posee alguna alergia?', required=False) | |
| tipo_alergia=forms.CharField(required=False) | |
| dieta=forms.BooleanField(label='Tiene alguna dieta especial?', required=False) | |
| tipo_dieta=forms.CharField(required=False) | |
| discapacidad=forms.BooleanField(required=False) | |
| tipo_discapacidad = forms.ChoiceField(label='Tipo de discapacidad', | |
| choices=(('Motora', 'Motora'), ('Mental', 'Mental'), | |
| ('Visual', 'Visual'), ('Auditiva', 'Auditiva'))) | |
| class Meta: | |
| model = UserProfile | |
| exclude = ['user'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment