From 122e800003a8963e6a42604878dbc5fa1fc99ba5 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 19 Jun 2015 19:08:34 -0300 Subject: [PATCH] Add all models to admin --- base/admin.py | 8 +++++++- comissoes/admin.py | 8 +++++++- lexml/admin.py | 8 +++++++- materia/admin.py | 8 +++++++- norma/admin.py | 8 +++++++- parlamentares/admin.py | 8 +++++++- protocoloadm/admin.py | 8 +++++++- sapl/settings.py | 2 +- sessao/admin.py | 8 +++++++- 9 files changed, 57 insertions(+), 9 deletions(-) diff --git a/base/admin.py b/base/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/base/admin.py +++ b/base/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/comissoes/admin.py b/comissoes/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/comissoes/admin.py +++ b/comissoes/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/lexml/admin.py b/lexml/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/lexml/admin.py +++ b/lexml/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/materia/admin.py b/materia/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/materia/admin.py +++ b/materia/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/norma/admin.py b/norma/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/norma/admin.py +++ b/norma/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/parlamentares/admin.py b/parlamentares/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/parlamentares/admin.py +++ b/parlamentares/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/protocoloadm/admin.py b/protocoloadm/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/protocoloadm/admin.py +++ b/protocoloadm/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model) diff --git a/sapl/settings.py b/sapl/settings.py index 321b6d2b6..53a89098a 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -25,7 +25,7 @@ SECRET_KEY = '!9g1-#la+#(oft(v-y1qhy$jk-2$24pdk69#b_jfqyv!*%a_)t' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] # Application definition diff --git a/sessao/admin.py b/sessao/admin.py index 8c38f3f3d..9daaf8098 100644 --- a/sessao/admin.py +++ b/sessao/admin.py @@ -1,3 +1,9 @@ +from django.apps import apps from django.contrib import admin -# Register your models here. + +appname = __name__.split('.')[0] +app = apps.get_app_config(appname) + +for model in app.get_models(): + admin.site.register(model)