source: seiven/economico/forms.py

Last change on this file was 5bd3e39, checked in by edgoldo <edgetrono@…>, 6 años ago

Modificación en consulta del submódulo PIB. Se incluyen las consultas de los submódulos Agregados Monetarios y Tasas de Interés

  • Propiedad mode establecida a 100644
File size: 21.1 KB
Línea 
1"""
2Sistema Estadístico Integral de Venezuela - (SEIVEN)
3
4Copyleft (@) 2015 CENDITEL nodo Mérida - https://mpv.cenditel.gob.ve/seiven
5"""
6## @namespace economico.forms
7#
8# Contiene las clases, atributos y métodos para los formularios a implementar en el módulo económico
9# @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
10# @author <a href='http://www.cenditel.gob.ve'>Centro Nacional de Desarrollo e Investigación en Tecnologías Libres
11# (CENDITEL) nodo Mérida - Venezuela</a>
12# @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
13from __future__ import unicode_literals
14
15from django.utils.encoding import python_2_unicode_compatible
16from django.utils.translation import ugettext_lazy as _
17
18import logging
19
20from django import forms
21from django.forms import (
22    ModelForm, TextInput, EmailInput, CharField, EmailField, PasswordInput,
23    Select, MultiWidget, MultiValueField, ChoiceField
24)
25
26from base.constant import (
27    DOMINIO_PRECIOS, DOMINIO_PIB, DOMINIO_AGREGADO_MONETARIO, TIPO_PIB, TIPO_DEMANDA_GLOBAL, TIPO_OFERTA_GLOBAL, TRIMESTRES, MESES,
28    DOMINIO_COMERCIAL, DOMINIO_CAMBIO, DOMINIO_CUENTA_CAPITAL, TIPO_BALANZA_COMERCIAL, DOMINIO_BALANZA_COMERCIAL, DOMINIO_TASAS_INTERES,
29    PERIODICIDAD,ELEMENTOS
30)
31from base.functions import cargar_anho_base, cargar_anho
32
33
34"""!
35Contiene el objeto que registra la vitacora de eventos del módulo económico.
36(configuración en el settings de la aplicación)
37"""
38logger = logging.getLogger("economico")
39
40
41@python_2_unicode_compatible
42class DominioForm(forms.Form):
43    """!
44    Clase que contiene el campo común para la selección del dominio
45
46    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
47    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
48    @date 20-09-2016
49    @version 1.0.0
50    """
51
52    ## Dominio del registro
53    dominio = ChoiceField(
54        label=_(u"Dominio"), choices=(),
55        widget=Select(attrs={
56            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
57            'title': _(u"Seleccione el dominio")
58        })
59    )
60
61
62@python_2_unicode_compatible
63class TipoForm(forms.Form):
64    """!
65    Clase que contiene el campo común para la selección del tipo
66
67    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
68    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
69    @date 20-09-2016
70    @version 1.0.0
71    """
72
73    ## Tipo de registro
74    tipo = ChoiceField(
75        label=_(u"Tipo"), choices=(),
76        widget=Select(attrs={
77            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
78            'title': _(u"Seleccione el tipo a registrar")
79        })
80    )
81
82
83@python_2_unicode_compatible
84class AnhoBaseForm(forms.Form):
85    """!
86    Clase que contiene el campo común para la selección del año base
87
88    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
89    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
90    @date 20-09-2016
91    @version 1.0.0
92    """
93
94    ## Año base a registrar
95    anho_base = ChoiceField(
96        label=_(u"Año Base"), choices=(),
97        widget=Select(attrs={
98            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
99            'title': _(u"Seleccione el año base")
100        })
101    )
102
103    def __init__(self, *args, **kwargs):
104        super(AnhoBaseForm, self).__init__(*args, **kwargs)
105        self.fields['anho_base'].choices = cargar_anho
106
107@python_2_unicode_compatible
108class PeriodicidadForm(forms.Form):
109    """!
110    Clase que contiene el campo común para la selección de la periodicidad
111
112    @author Edgar A. Linares (elinares at cenditel.gob.ve)
113    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
114    @date 26-04-2017
115    @version 1.0.0
116    """
117
118    ## Opciones de periodicidad
119    periodicidad = ChoiceField(
120        label=_(u"Periodicidad"), choices=(),
121        widget=Select(attrs={
122            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
123            'title': _(u"Seleccione la periodicidad")
124        })
125    )
126
127@python_2_unicode_compatible
128class ElementosForm(forms.Form):
129    """!
130    Clase que contiene el campo común para la selección de elementos
131
132    @author Ing. Luis Barrios (lbarrios at cenditel.gob.ve)
133    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
134    @date 23-08-2017
135    @version 1.0.0
136    """
137
138    ## Opciones de elementos
139    elementos = ChoiceField(
140        label=_(u"Elementos"), choices=(),
141        widget=Select(attrs={
142            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
143            'title': _(u"Seleccione los elementos")
144        })
145    )
146
147@python_2_unicode_compatible
148class MesIniForm(forms.Form):
149    """!
150    Clase que contiene el campo común para la selección del período del mes inicial
151
152    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
153    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
154    @date 20-09-2016
155    @version 1.0.0
156    """
157
158    ## Mes inicial
159    periodo_mes_ini = ChoiceField(
160        label=_(u"Desde"), choices=MESES,
161        widget=Select(attrs={
162            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
163            'title': _(u"Seleccione el mes inicial")
164        })
165    )
166
167
168@python_2_unicode_compatible
169class MesFinForm(forms.Form):
170    """!
171    Clase que contiene el campo común para la selección del período del mes final
172
173    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
174    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
175    @date 20-09-2016
176    @version 1.0.0
177    """
178
179    ## Mes final
180    periodo_mes_fin = ChoiceField(
181        label=_(u"Hasta"), choices=MESES,
182        widget=Select(attrs={
183            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
184            'title': _(u"Seleccione el mes final")
185        })
186    )
187
188
189@python_2_unicode_compatible
190class AnhoIniForm(forms.Form):
191    """!
192    Clase que contiene el campo común para la selección del período del año inicial
193
194    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
195    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
196    @date 20-09-2016
197    @version 1.0.0
198    """
199
200    ## Año inicial
201    periodo_anho_ini = ChoiceField(
202        label=_('Desde'), choices=(),
203        widget=Select(attrs={
204            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
205            'title': _(u"Seleccione el año inicial")
206        })
207    )
208
209    def __init__(self, *args, **kwargs):
210        super(AnhoIniForm, self).__init__(*args, **kwargs)
211        self.fields['periodo_anho_ini'].choices = cargar_anho_base(anho_inicial='1970')
212
213
214@python_2_unicode_compatible
215class AnhoFinForm(forms.Form):
216    """!
217    Clase que contiene el campo común para la selección del período del año final
218
219    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
220    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
221    @date 20-09-2016
222    @version 1.0.0
223    """
224
225    ## Año final
226    periodo_anho_fin = ChoiceField(
227        label=_('Hasta'), choices=(),
228        widget=Select(attrs={
229            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
230            'title': _(u"Seleccione el año final")
231        })
232    )
233
234    def __init__(self, *args, **kwargs):
235        super(AnhoFinForm, self).__init__(*args, **kwargs)
236        self.fields['periodo_anho_fin'].choices = cargar_anho_base(anho_inicial='1970')
237
238
239@python_2_unicode_compatible
240class TrimestreIniForm(forms.Form):
241    """!
242    Clase que contiene el campo común para la selección del período del trimestre inicial
243
244    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
245    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
246    @date 20-09-2016
247    @version 1.0.0
248    """
249
250    ## Trimestre inicial
251    periodo_trimestre_ini = ChoiceField(
252        label=_(u"Desde"), choices=TRIMESTRES,
253        widget=Select(attrs={
254            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
255            'title': _(u"Seleccione el trimestre inicial")
256        })
257    )
258
259
260@python_2_unicode_compatible
261class TrimestreFinForm(forms.Form):
262    """!
263    Clase que contiene el campo común para la selección del período del trimestre final
264
265    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
266    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
267    @date 20-09-2016
268    @version 1.0.0
269    """
270
271    ## Trimestre final
272    periodo_trimestre_fin = ChoiceField(
273        label=_(u"Hasta"), choices=TRIMESTRES,
274        widget=Select(attrs={
275            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
276            'title': _(u"Seleccione el trimestre final")
277        })
278    )
279
280
281@python_2_unicode_compatible
282class SemanaIniForm(forms.Form):
283    """!
284    Clase que contiene el campo común para la selección del período de la semana inicial
285
286    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
287    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
288    @date 20-09-2016
289    @version 1.0.0
290    """
291
292    ## Semana inicial
293    periodo_semana_ini = ChoiceField(
294        label=_("Desde"), choices=(),
295        widget=Select(attrs={
296            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
297            'title': _(u"Seleccione la semana inicial")
298        })
299    )
300
301
302@python_2_unicode_compatible
303class SemanaFinForm(forms.Form):
304    """!
305    Clase que contiene el campo común para la selección del período de la semana final
306
307    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
308    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
309    @date 20-09-2016
310    @version 1.0.0
311    """
312
313    ## Semana final
314    periodo_semana_fin = ChoiceField(
315        label=_("Hasta"), choices=(),
316        widget=Select(attrs={
317            'class': 'select2 select2-offscreen form-control', 'data-toggle': 'tooltip',
318            'title': _(u"Seleccione la semana final")
319        })
320    )
321
322
323@python_2_unicode_compatible
324class StartDateForm(forms.Form):
325    """!
326    Clase que contiene el campo común para la fecha inicial de consulta
327
328    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
329    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
330    @date 20-09-2016
331    @version 1.0.0
332    """
333    start_date = CharField(label=_('Desde'), max_length=10, widget=TextInput(attrs={
334        'class': 'form-control fecha', 'data-toggle': 'tooltip', 'title': _('Indique la fecha inicial'),
335    }))
336
337
338@python_2_unicode_compatible
339class EndDateForm(forms.Form):
340    """!
341    Clase que contiene el campo común para la fecha final de consulta
342
343    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
344    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
345    @date 20-09-2016
346    @version 1.0.0
347    """
348    end_date = CharField(label=_('Hasta'), max_length=10, widget=TextInput(attrs={
349        'class': 'form-control fecha', 'data-toggle': 'tooltip', 'title': _('Indique la fecha final')
350    }))
351
352
353@python_2_unicode_compatible
354class RealPreciosForm(AnhoBaseForm, DominioForm, MesIniForm, MesFinForm, AnhoIniForm, AnhoFinForm,PeriodicidadForm, ElementosForm):
355    """!
356    Clase que contiene el formulario para la carga de datos de precios
357
358    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
359    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
360    @date 19-09-2016
361    @version 1.0.0
362    """
363
364    def __init__(self, *args, **kwargs):
365        super(RealPreciosForm, self).__init__(*args, **kwargs)
366        self.fields['dominio'].choices = DOMINIO_PRECIOS
367        self.fields['periodicidad'].choices = [PERIODICIDAD[0],PERIODICIDAD[3],PERIODICIDAD[4],PERIODICIDAD[5]]
368        self.fields['elementos'].choices = ELEMENTOS
369
370
371@python_2_unicode_compatible
372class PIBForm(TipoForm, AnhoBaseForm, DominioForm, AnhoIniForm, AnhoFinForm, TrimestreIniForm, TrimestreFinForm, ElementosForm):
373    """!
374    Clase que contiene el formulario para la carga de datos de PIB
375
376    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
377    @author Edgar A. Linares (elinares at cenditel.gob.ve)
378    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
379    @date 19-09-2016
380    @date 05-04-2017
381    @version 1.0.0
382    """
383
384    def __init__(self, *args, **kwargs):
385        super(PIBForm, self).__init__(*args, **kwargs)
386        self.fields['dominio'].choices = DOMINIO_PIB
387        self.fields['tipo'].choices = TIPO_PIB
388        self.fields['elementos'].choices = [ELEMENTOS[0], ELEMENTOS[2], ELEMENTOS[5], ELEMENTOS[6], ELEMENTOS[8]]
389
390
391@python_2_unicode_compatible
392class RealDemandaGlobalForm(AnhoBaseForm, AnhoIniForm, AnhoFinForm, TrimestreIniForm, TrimestreFinForm, TipoForm,PeriodicidadForm, ElementosForm):
393    """!
394    Clase que contiene el formulario para la carga de datos de demanda global
395
396    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
397    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
398    @date 19-09-2016
399    @version 1.0.0
400    """
401
402    def __init__(self, *args, **kwargs):
403        super(RealDemandaGlobalForm, self).__init__(*args, **kwargs)
404        self.fields['tipo'].choices = TIPO_DEMANDA_GLOBAL
405        self.fields['periodicidad'].choices = [PERIODICIDAD[0],PERIODICIDAD[4],PERIODICIDAD[5]]
406        self.fields['elementos'].choices = ELEMENTOS
407
408@python_2_unicode_compatible
409class RealOfertaGlobalForm(AnhoBaseForm, AnhoIniForm, AnhoFinForm, TrimestreIniForm, TrimestreFinForm, TipoForm):
410    """!
411    Clase que contiene el formulario para la carga de datos de Oferta global
412
413    @author Ing. Luis Barrios (lbarrios at cenditel.gob.ve)
414    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
415    @date 22-03-2017
416    @version 1.0.0
417    """
418
419    def __init__(self, *args, **kwargs):
420        super(RealOfertaGlobalForm, self).__init__(*args, **kwargs)
421        self.fields['tipo'].choices = TIPO_OFERTA_GLOBAL
422
423@python_2_unicode_compatible
424class MonetarioAgregadosForm(DominioForm, StartDateForm, EndDateForm, SemanaIniForm, SemanaFinForm, MesIniForm, MesFinForm, AnhoIniForm, AnhoFinForm, ElementosForm):
425    """!
426    Clase que contiene el formulario para la carga de datos de Agregados Monetarios
427
428    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
429    @author Edgar A. Linares (elinares at cenditel.gob.ve)
430    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
431    @date 19-09-2016
432    @date 30-05-2017
433    @version 1.0.0
434    """
435
436    def __init__(self, *args, **kwargs):
437        super(MonetarioAgregadosForm, self).__init__(*args, **kwargs)
438        self.fields['dominio'].choices = DOMINIO_AGREGADO_MONETARIO
439        self.fields['elementos'].choices = [ELEMENTOS[0], ELEMENTOS[2:7], ELEMENTOS[8]]
440
441
442@python_2_unicode_compatible
443class MonetarioOperacionesInterbancariasForm(StartDateForm, EndDateForm):
444    """!
445    Clase que contiene el formulario para la carga de datos de Operaciones Interbancarias
446
447    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
448    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
449    @date 19-09-2016
450    @version 1.0.0
451    """
452
453
454@python_2_unicode_compatible
455class MonetarioTasasInteresForm(DominioForm, PeriodicidadForm, StartDateForm, EndDateForm, SemanaIniForm, SemanaFinForm, MesIniForm, MesFinForm, AnhoIniForm, AnhoFinForm, ElementosForm):
456    """!
457    Clase que contiene el formulario para la carga de datos de Tasas de Interés
458
459    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
460    @author Edgar A. Linares (elinares at cenditel.gob.ve)
461    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
462    @date 19-09-2016
463    @date 26-04-2017
464    @version 1.0.0
465    """
466
467    def __init__(self, *args, **kwargs):
468        super(MonetarioTasasInteresForm, self).__init__(*args, **kwargs)
469        self.fields['dominio'].choices = DOMINIO_TASAS_INTERES
470        self.fields['periodicidad'].choices = PERIODICIDAD
471        self.fields['elementos'].choices = [ELEMENTOS[0], ELEMENTOS[2]]
472
473@python_2_unicode_compatible
474class MonetarioInstrumentoPoliticaForm(MesIniForm, MesFinForm, AnhoIniForm, AnhoFinForm):
475    """!
476    Clase que contiene el formulario para la carga de datos de Instrumentos de Políticas
477
478    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
479    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
480    @date 19-09-2016
481    @version 1.0.0
482    """
483
484@python_2_unicode_compatible
485class ExternoBalanzaComercialForm(TipoForm, DominioForm, AnhoBaseForm, TrimestreIniForm, TrimestreFinForm, AnhoIniForm, AnhoFinForm):
486    """!
487    Clase que contiene el formulario para la carga de datos de Balanza Comercial
488
489    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
490    @author Rodrigo Boet (rboet at cenditel.gob.ve)
491    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
492    @date 19-09-2016
493    @version 1.0.0
494    """
495
496    def __init__(self, *args, **kwargs):
497        super(ExternoBalanzaComercialForm, self).__init__(*args, **kwargs)
498        self.fields['tipo'].choices = TIPO_BALANZA_COMERCIAL
499        self.fields['dominio'].choices = DOMINIO_BALANZA_COMERCIAL
500        self.fields['anho_base'].choices = cargar_anho_base(anho_inicial='1997',anho_final='1997')
501        self.fields['anho_base'].required = False
502        ## Se deshabilitan los campos
503        self.fields['dominio'].widget.attrs.update({'disabled': True})
504        self.fields['anho_base'].widget.attrs.update({'disabled': True})
505        self.fields['periodo_trimestre_ini'].widget.attrs.update({'disabled': True})
506        self.fields['periodo_trimestre_fin'].widget.attrs.update({'disabled': True})
507        self.fields['periodo_anho_ini'].widget.attrs.update({'disabled': True})
508        self.fields['periodo_anho_fin'].widget.attrs.update({'disabled': True})
509        ## Se agregan las funciones javascript
510        self.fields['tipo'].widget.attrs.update({'onchange': 'edit_dom_bc($(this).val(),"id_dominio");'})
511
512
513@python_2_unicode_compatible
514class ExternoCuentaCapitalForm(forms.Form):
515    """!
516    Clase que contiene el formulario para la carga de datos de Cuentas de Capital
517
518    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
519    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
520    @date 19-09-2016
521    @version 1.0.0
522    """
523    pass
524
525
526@python_2_unicode_compatible
527class ExternoReservaCambioForm(
528    DominioForm, StartDateForm, EndDateForm, SemanaIniForm, SemanaFinForm, MesIniForm, MesFinForm, AnhoIniForm, AnhoFinForm
529):
530    """!
531    Clase que contiene el formulario para la carga de datos de Reservas - Tipo de Cambio
532
533    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
534    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
535    @date 19-09-2016
536    @version 1.0.0
537    """
538
539    def __init__(self, *args, **kwargs):
540        super(ExternoReservaCambioForm, self).__init__(*args, **kwargs)
541        self.fields['dominio'].choices = DOMINIO_CAMBIO
542
543
544@python_2_unicode_compatible
545class FiscalForm(AnhoIniForm, AnhoFinForm):
546    """!
547    Clase que contiene el formulario para la carga de datos de Registros Fiscales
548
549    @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
550    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
551    @date 19-09-2016
552    @version 1.0.0
553    """
554   
555   
556@python_2_unicode_compatible
557class CapitalForm(DominioForm, TrimestreIniForm, TrimestreFinForm, AnhoIniForm, AnhoFinForm):
558    """!
559    Clase que contiene el formulario para la carga de datos de Cuenta Capital
560
561    @author Rodrigo Boet (rboet at cenditel.gob.ve)
562    @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a>
563    @date 23-03-2017
564    @version 1.0.0
565    """
566    def __init__(self, *args, **kwargs):
567        super(CapitalForm, self).__init__(*args, **kwargs)
568        self.fields['dominio'].choices = DOMINIO_CUENTA_CAPITAL
569        ## Se deshabilitan los campos
570        self.fields['periodo_trimestre_ini'].widget.attrs.update({'disabled': True})
571        self.fields['periodo_trimestre_fin'].widget.attrs.update({'disabled': True})
572        self.fields['periodo_anho_ini'].widget.attrs.update({'disabled': True})
573        self.fields['periodo_anho_fin'].widget.attrs.update({'disabled': True})
574        ## Se agregan las funciones en javascript
575        self.fields['dominio'].widget.attrs.update({'onchange': 'edit_fields_cc($(this).val());'})
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.