Changeset 0dff879 in sicp
- Timestamp:
- May 8, 2015, 10:46:40 AM (9 years ago)
- Branches:
- master
- Children:
- 73fe6cd
- Parents:
- 5de4c2a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/usuario/forms.py
r09911a1 r0dff879 19 19 __doc__ = "Estructura de los formularios para el registro y acceso de usuarios al sistema" 20 20 21 from django.forms import ModelForm, ChoiceField, TextInput, EmailInput, CharField 21 from django.forms import ModelForm, ChoiceField, TextInput, EmailInput, CharField, Select 22 22 from django.contrib.auth.models import User 23 23 from django.utils.translation import ugettext_lazy as _ 24 from captcha.fields import CaptchaField, CaptchaTextInput 24 25 from apps.usuario.models import Institucion, Cargo, UserProfile 25 26 … … 64 65 return lista 65 66 66 class UsuarioForm(ModelForm):67 class RegistroForm(ModelForm): 67 68 68 69 institucion = ChoiceField(label=_(u"Institución"), choices=cargar_institucion(), 69 70 widget=Select(attrs={'class': 'select2 form-control select2-offscreen', 70 71 'title': _(u"Seleccione la institución")})) 71 cargo = ChoiceField(label=_(u"Cargo"), choices=cargar_cargo(),72 widget=Select(attrs={'class': 'select2 form-control select2-offscreen',73 'title': _(u"Seleccione el cargo")}))74 72 nombre = CharField(label=_(u"Nombres"), widget=TextInput(attrs={'class': 'form-control', 75 73 'placeholder': _(u"nombres"), … … 78 76 'placeholder': _(u"apellidos"), 79 77 'data-rule-required': 'true'})) 78 cargo = ChoiceField(label=_(u"Cargo"), choices=cargar_cargo(), 79 widget=Select(attrs={'class': 'select2 form-control select2-offscreen', 80 'title': _(u"Seleccione el cargo")})) 80 81 correo = CharField(label=_(u"Correo"), widget=EmailInput(attrs={'class': 'form-control', 81 82 'placeholder': _(u"correo electrónico"), 82 83 'data-rule-required': 'true'})) 84 cedula = CharField(label=_(u"Cédula"), 85 widget=TextInput(attrs={'class': 'form-control', 'placeholder': _(u"cédula de identidad"), 86 'data-rule-required': 'true', 87 'title': _(u"indique la cedula de identidad la cual sera " 88 u"su nombre de usuario")})) 89 captcha = CaptchaField(label=_(u"Captcha"), 90 widget=CaptchaTextInput(attrs={'class': 'form-control', 91 'placeholder': _(u"letras de imagen")})) 92 93 83 94 84 95 class Meta: 85 96 model = UserProfile 86 widgets = { 87 'user': TextInput(attrs={'class': 'form-control', 'placeholder': _(u"cédula de identidad"), 88 'data-rule-required': 'true'}) 89 } 97 exclude = ['fecha_modpass', 'user']
Note: See TracChangeset
for help on using the changeset viewer.