Commit ae80961b authored by Florent Chehab's avatar Florent Chehab
Browse files

cleaner admin.py

parent 86ee2fdf
...@@ -43,7 +43,7 @@ MIDDLEWARE = [ ...@@ -43,7 +43,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'general.middleware.LoginRequiredMiddleware', 'general.middleware.LoginRequiredMiddleware',
] ]
LOGIN_URL = '/user/login' LOGIN_URL = '/user/login'
......
...@@ -7,13 +7,22 @@ from rex.models.university import SemestersDates ...@@ -7,13 +7,22 @@ from rex.models.university import SemestersDates
from rex.models.university import UniversityInsurance from rex.models.university import UniversityInsurance
from rex.models.location import Country, City from rex.models.location import Country, City
CLASSIC_MODELS = [
Country,
City
]
admin.site.register(Country) VERSIONNED_MODELS = [
admin.site.register(City) University,
Campus,
UniversityScholarship,
UniversityInfo,
SemestersDates,
UniversityInsurance
]
admin.site.register(University, CompareVersionAdmin) for model in CLASSIC_MODELS:
admin.site.register(Campus, CompareVersionAdmin) admin.site.register(model)
admin.site.register(UniversityScholarship, CompareVersionAdmin)
admin.site.register(UniversityInfo, CompareVersionAdmin) for model in VERSIONNED_MODELS:
admin.site.register(SemestersDates, CompareVersionAdmin) admin.site.register(model, CompareVersionAdmin)
admin.site.register(UniversityInsurance, CompareVersionAdmin)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment