1 | """ |
---|
2 | Sistema Estadístico Integral de Venezuela - (SEIVEN) |
---|
3 | |
---|
4 | Copyleft (@) 2015 CENDITEL nodo Mérida - https://mpv.cenditel.gob.ve/seiven |
---|
5 | """ |
---|
6 | ## @namespace usuario.admin |
---|
7 | # |
---|
8 | # Contiene las clases, atributos y métodos que serán mostrados en el panel de administración |
---|
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> |
---|
13 | from __future__ import unicode_literals |
---|
14 | |
---|
15 | from django.contrib import admin |
---|
16 | from django.contrib.auth.admin import UserAdmin |
---|
17 | from django.contrib.auth.models import User |
---|
18 | from django.utils.translation import ugettext_lazy as _ |
---|
19 | from .models import UserProfile |
---|
20 | |
---|
21 | import logging |
---|
22 | |
---|
23 | logger = logging.getLogger("base") |
---|
24 | |
---|
25 | __licence__ = "GNU Public License v2" |
---|
26 | __revision__ = "" |
---|
27 | __docstring__ = "DoxyGen" |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | admin.site.unregister(User) |
---|
32 | |
---|
33 | class UserProfileInline(admin.StackedInline): |
---|
34 | model = UserProfile |
---|
35 | fk_name = 'user' |
---|
36 | max_num = 1 |
---|
37 | can_delete = False |
---|
38 | readonly_fields = ('tipo_documento', 'ocupacion', 'fecha_modpass', 'institucion') |
---|
39 | |
---|
40 | class UserProfileAdmin(UserAdmin): |
---|
41 | inlines = (UserProfileInline,) |
---|
42 | |
---|
43 | |
---|
44 | admin.site.register(User, UserProfileAdmin) |
---|