[bf47591] | 1 | |
---|
| 2 | from django import forms |
---|
[94b3e3f] | 3 | from django.forms.fields import ( |
---|
| 4 | CharField, BooleanField |
---|
| 5 | ) |
---|
[bf47591] | 6 | |
---|
| 7 | from .models import * |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | class EventoForm(forms.ModelForm): |
---|
| 11 | """! |
---|
| 12 | Clase que permite crear el formulario para el create or update del evento |
---|
| 13 | |
---|
| 14 | @author Ing. Leonel P. Hernandez M. (lhernandez at cenditel.gob.ve) |
---|
[5dea5ff] | 15 | @copyright <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU Public License versión 3 (GPLv3)</a> |
---|
[bf47591] | 16 | @date 19-11-2017 |
---|
| 17 | @version 1.0.0 |
---|
| 18 | """ |
---|
[94b3e3f] | 19 | archivo = CharField() |
---|
[d3c0ab7] | 20 | |
---|
[bf47591] | 21 | class Meta: |
---|
| 22 | """! |
---|
| 23 | Clase que construye los meta datos del formulario |
---|
| 24 | """ |
---|
| 25 | model = Evento |
---|
[8fa24c3] | 26 | exclude = ['activo', 'serial'] |
---|
[bf47591] | 27 | |
---|
| 28 | def __init__(self, *args, **kwargs): |
---|
| 29 | """! |
---|
| 30 | Funcion que construye los valores iniciales del formulario evento |
---|
| 31 | """ |
---|
| 32 | super(EventoForm, self).__init__(*args, **kwargs) |
---|
| 33 | self.fields['nombre_evento'].widget.attrs.update( |
---|
| 34 | {'class': 'form-control', |
---|
| 35 | 'placeholder': 'Nombre del evento'}) |
---|
| 36 | self.fields['fecha'].widget.attrs.update( |
---|
[3397a08] | 37 | {'class': 'datepicker', |
---|
[94b3e3f] | 38 | 'placeholder': 'Fecha', |
---|
| 39 | 'readonly': |
---|
| 40 | 'readonly'}) |
---|
[8fa24c3] | 41 | self.fields['archivo'].required=True |
---|
[3397a08] | 42 | self.fields['archivo'].widget.attrs.update( |
---|
[d3c0ab7] | 43 | {'class': 'file-path validate', |
---|
[a4764f9] | 44 | 'placeholder': 'Subir Archivo', |
---|
| 45 | 'accept': '.pdf'}) |
---|
[248b1b4] | 46 | |
---|
| 47 | class FirmaEventoForm(forms.Form): |
---|
| 48 | """! |
---|
| 49 | Clase que permite crear el formulario para la firma de un documento |
---|
| 50 | |
---|
| 51 | @author Rodrigo Boet (rboet at cenditel.gob.ve) |
---|
[5dea5ff] | 52 | @copyright <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU Public License versión 3 (GPLv3)</a> |
---|
[248b1b4] | 53 | @date 20-11-2017 |
---|
| 54 | @version 1.0.0 |
---|
| 55 | """ |
---|
[16cf088] | 56 | pasaporte = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Ingrese su pasaporte'})) |
---|