Last change
on this file since 7cad786 was
bf47591,
checked in by Leonel Hernandez <leonelphm@…>, 7 years ago
|
Inicializando Proyecto
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[bf47591] | 1 | |
---|
| 2 | from django import forms |
---|
| 3 | |
---|
| 4 | from .models import * |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | class EventoForm(forms.ModelForm): |
---|
| 8 | """! |
---|
| 9 | Clase que permite crear el formulario para el create or update del evento |
---|
| 10 | |
---|
| 11 | @author Ing. Leonel P. Hernandez M. (lhernandez at cenditel.gob.ve) |
---|
| 12 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
| 13 | @date 19-11-2017 |
---|
| 14 | @version 1.0.0 |
---|
| 15 | """ |
---|
| 16 | |
---|
| 17 | class Meta: |
---|
| 18 | """! |
---|
| 19 | Clase que construye los meta datos del formulario |
---|
| 20 | """ |
---|
| 21 | model = Evento |
---|
| 22 | exclude = ['activo'] |
---|
| 23 | |
---|
| 24 | def __init__(self, *args, **kwargs): |
---|
| 25 | """! |
---|
| 26 | Funcion que construye los valores iniciales del formulario evento |
---|
| 27 | """ |
---|
| 28 | super(EventoForm, self).__init__(*args, **kwargs) |
---|
| 29 | self.fields['nombre_evento'].widget.attrs.update( |
---|
| 30 | {'class': 'form-control', |
---|
| 31 | 'placeholder': 'Nombre del evento'}) |
---|
| 32 | self.fields['fecha'].widget.attrs.update( |
---|
| 33 | {'class': 'form-control', |
---|
| 34 | 'placeholder': 'Fecha', 'data-provide': 'datepicker'}) |
---|
| 35 | self.fields['serial'].widget.attrs.update( |
---|
| 36 | {'class': 'form-control', |
---|
| 37 | 'placeholder': 'Serial'}) |
---|
Note: See
TracBrowser
for help on using the repository browser.