1 | from django.db import models |
---|
2 | |
---|
3 | |
---|
4 | class Pais(models.Model): |
---|
5 | """! |
---|
6 | Clase que contiene los paÃses |
---|
7 | |
---|
8 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
9 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
10 | @date 10-05-2016 |
---|
11 | @version 2.0.0 |
---|
12 | """ |
---|
13 | |
---|
14 | ## Nombre del pais |
---|
15 | nombre = models.CharField(max_length=50) |
---|
16 | |
---|
17 | def __str__(self): |
---|
18 | """! |
---|
19 | Método que muestra la información sobre el Pais |
---|
20 | |
---|
21 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
22 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
23 | @date 29-06-2016 |
---|
24 | @param self <b>{object}</b> Objeto que instancia la clase |
---|
25 | @return Devuelve los datos del Pais |
---|
26 | """ |
---|
27 | return self.nombre |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | class Estado(models.Model): |
---|
32 | """! |
---|
33 | Clase que contiene los Estados de un Pais |
---|
34 | |
---|
35 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
36 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
37 | @date 10-05-2016 |
---|
38 | @version 2.0.0 |
---|
39 | """ |
---|
40 | |
---|
41 | ## Nombre del Estado |
---|
42 | nombre = models.CharField(max_length=50) |
---|
43 | |
---|
44 | ## Pais en donde esta ubicado el Estado |
---|
45 | pais = models.ForeignKey(Pais) |
---|
46 | |
---|
47 | |
---|
48 | def __str__(self): |
---|
49 | """! |
---|
50 | Método que muestra la información sobre el Estado |
---|
51 | |
---|
52 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
53 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
54 | @date 29-06-2016 |
---|
55 | @param self <b>{object}</b> Objeto que instancia la clase |
---|
56 | @return Devuelve los datos del Estado |
---|
57 | """ |
---|
58 | return self.nombre |
---|
59 | |
---|
60 | |
---|
61 | class Municipio(models.Model): |
---|
62 | """! |
---|
63 | Clase que contiene los Municipios de un Estado |
---|
64 | |
---|
65 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
66 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
67 | @date 10-05-2016 |
---|
68 | @version 2.0.0 |
---|
69 | """ |
---|
70 | |
---|
71 | ## Nombre del Municipio |
---|
72 | nombre = models.CharField(max_length=50) |
---|
73 | |
---|
74 | ## Estado en donde se encuentra el Municipio |
---|
75 | estado = models.ForeignKey(Estado) |
---|
76 | |
---|
77 | def __str__(self): |
---|
78 | """! |
---|
79 | Método que muestra la información sobre el Municipio |
---|
80 | |
---|
81 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
82 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
83 | @date 29-06-2016 |
---|
84 | @param self <b>{object}</b> Objeto que instancia la clase |
---|
85 | @return Devuelve los datos del Municipio |
---|
86 | """ |
---|
87 | return self.nombre |
---|
88 | |
---|
89 | |
---|
90 | class Parroquia(models.Model): |
---|
91 | """! |
---|
92 | Clase que contiene las parroquias de un Municipio |
---|
93 | |
---|
94 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
95 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
96 | @date 10-05-2016 |
---|
97 | @version 2.0.0 |
---|
98 | """ |
---|
99 | |
---|
100 | ## Nombre de la Parroquia |
---|
101 | nombre = models.CharField(max_length=50) |
---|
102 | |
---|
103 | ## Municipio en el que se encuentra ubicada la Parroquia |
---|
104 | municipio = models.ForeignKey(Municipio) |
---|
105 | |
---|
106 | class Meta: |
---|
107 | ordering = ('nombre',) |
---|
108 | |
---|
109 | def __str__(self): |
---|
110 | """! |
---|
111 | Método que muestra la información sobre la Parroquia |
---|
112 | |
---|
113 | @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) |
---|
114 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
115 | @date 29-06-2016 |
---|
116 | @param self <b>{object}</b> Objeto que instancia la clase |
---|
117 | @return Devuelve los datos de la Parroquia |
---|
118 | """ |
---|
119 | return self.nombre |
---|
120 | |
---|
121 | |
---|
122 | class TipoDocumento(models.Model): |
---|
123 | """! |
---|
124 | Clase que contiene el tipo de documento |
---|
125 | |
---|
126 | @author Ing. Leonel P. Hernandez M. (lhernandez at cenditel.gob.ve) |
---|
127 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
128 | @date 25-05-2017 |
---|
129 | @version 1.0.0 |
---|
130 | """ |
---|
131 | abreviatura = models.CharField(max_length=4, verbose_name='Acrónimo') |
---|
132 | descripcion = models.TextField() |
---|
133 | |
---|
134 | class Meta: |
---|
135 | ordering = ('abreviatura',) |
---|
136 | verbose_name = 'Tipo Documento' |
---|
137 | verbose_name_plural = 'Tipos Documentos' |
---|
138 | |
---|
139 | def __str__(self): |
---|
140 | return self.abreviatura |
---|
141 | |
---|
142 | |
---|
143 | class Institucion(models.Model): |
---|
144 | """! |
---|
145 | Clase que contiene Las instituciones |
---|
146 | |
---|
147 | @author Ing. Leonel P. Hernandez M. (lhernandez at cenditel.gob.ve) |
---|
148 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
149 | @date 25-05-2017 |
---|
150 | @version 1.0.0 |
---|
151 | """ |
---|
152 | nombre = models.CharField(max_length=255) |
---|
153 | |
---|
154 | class Meta: |
---|
155 | ordering = ('nombre',) |
---|
156 | verbose_name = 'Institucion' |
---|
157 | verbose_name_plural = 'Instituciones' |
---|
158 | |
---|
159 | def __str__(self): |
---|
160 | return self.nombre |
---|
161 | |
---|
162 | |
---|
163 | class TipoCargo(models.Model): |
---|
164 | """! |
---|
165 | Clase que contiene el tipo de cargo del usuario |
---|
166 | |
---|
167 | @author Ing. Leonel P. Hernandez M. (lhernandez at cenditel.gob.ve) |
---|
168 | @copyright <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU Public License versión 2 (GPLv2)</a> |
---|
169 | @date 25-05-2017 |
---|
170 | @version 1.0.0 |
---|
171 | """ |
---|
172 | nombre = models.CharField(max_length=120) |
---|
173 | |
---|
174 | class Meta: |
---|
175 | ordering = ('nombre',) |
---|
176 | verbose_name = 'Cargo' |
---|
177 | verbose_name_plural = 'Cargos' |
---|
178 | |
---|
179 | def __str__(self): |
---|
180 | return self.nombre |
---|