|
@ -14,7 +14,8 @@ from django.core.exceptions import ValidationError |
|
|
from django.db import transaction |
|
|
from django.db import transaction |
|
|
from django.forms import ModelForm |
|
|
from django.forms import ModelForm |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
from sigi.apps.casas.models import CasaLegislativa |
|
|
|
|
|
from easy_select2 import Select2 |
|
|
|
|
|
|
|
|
import sigi.apps.crispy_layout_mixin |
|
|
import sigi.apps.crispy_layout_mixin |
|
|
from sigi.apps.crud.utils import YES_NO_CHOICES |
|
|
from sigi.apps.crud.utils import YES_NO_CHOICES |
|
@ -87,6 +88,11 @@ class UsuarioForm(ModelForm): |
|
|
|
|
|
|
|
|
captcha = CaptchaField() |
|
|
captcha = CaptchaField() |
|
|
|
|
|
|
|
|
|
|
|
casa_legislativa = forms.ModelChoiceField( |
|
|
|
|
|
queryset=CasaLegislativa.objects.all(), |
|
|
|
|
|
widget=Select2() |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
class Meta(object): |
|
|
class Meta(object): |
|
|
model = Usuario |
|
|
model = Usuario |
|
|
fields = [u'username', u'email', u'nome_completo', u'password', |
|
|
fields = [u'username', u'email', u'nome_completo', u'password', |
|
|