Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
66ca721d
Commit
66ca721d
authored
Aug 29, 2018
by
Florent Chehab
Browse files
update admin.py
parent
5ded69c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
66ca721d
...
...
@@ -11,3 +11,4 @@ htmlcov
.vscode
.pytest_cache
/backend/urls.py
/backend/admin.py
backend/admin.py
View file @
66ca721d
from
django.contrib
import
admin
from
reversion_compare.admin
import
CompareVersionAdmin
from
backend.models.location
import
Country
,
City
from
backend.models.location
import
CountryCulture
from
backend.models.location
import
CountryHealthInsurance
from
backend.models.location
import
CountryOtherInsurance
from
backend.models.location
import
CountryTransport
from
backend.models.location
import
CountryTourism
from
backend.models.location
import
CountryOtherStuff
from
backend.models.location
import
CountryVisaAdministrative
from
backend.models.location
import
CountryPhoto
from
backend.models.location
import
CountryScholarship
from
backend.models.location
import
CountryDri
from
backend.models.location
import
CityTransport
from
backend.models.location
import
CityTourism
from
backend.models.location
import
CityOtherStuff
from
backend.models.university
import
University
from
backend.models.university
import
Campus
from
backend.models.university
import
UniversityScholarship
from
backend.models.university
import
UniversityInfo
from
backend.models.university
import
UniversitySemestersDates
from
backend.models.university
import
UniversityInsurance
from
backend.models.university
import
UniversityCourses
from
backend.models.university
import
UniversityCulture
from
backend.models.university
import
UniversityOtherStuff
from
backend.models.university
import
UniversitySpecialOffer
from
backend.models.university
import
UniversityPhoto
from
backend.models.university
import
UniversityDri
from
backend.models.university
import
CampusTransport
from
backend.models.university
import
CampusAccommodation
from
backend.models.university
import
CampusCultureAndStudentLife
from
backend.models.university
import
CampusOtherStuff
from
backend.models.module
import
Currency
from
backend.models.otherCore
import
Department
from
backend.models.otherCore
import
Offer
from
backend.models.otherCore
import
Semester
from
backend.models.otherCore
import
Specialty
from
backend.models.user
import
Recommendation
from
backend.models.user
import
RecommendationList
from
backend.models.user
import
PreviousDeparture
from
backend.models.user
import
PreviousDepartureFeedback
from
backend.models.user
import
UserData
from
backend.models.my_model
import
PendingModeration
from
backend.models.module
import
Tag
CLASSIC_MODELS
=
[
Country
,
City
,
Currency
,
University
,
Department
,
Offer
,
Semester
,
Specialty
,
Recommendation
,
RecommendationList
,
PreviousDeparture
,
PreviousDepartureFeedback
,
UserData
,
PendingModeration
,
Tag
]
VERSIONNED_MODELS
=
[
Campus
,
UniversityScholarship
,
UniversityInfo
,
UniversitySemestersDates
,
UniversityInsurance
,
UniversityCulture
,
UniversityCourses
,
UniversityOtherStuff
,
UniversitySpecialOffer
,
UniversityPhoto
,
CountryCulture
,
CountryHealthInsurance
,
CountryOtherInsurance
,
CountryTransport
,
CountryTourism
,
CountryOtherStuff
,
CountryVisaAdministrative
,
CountryPhoto
,
CountryScholarship
,
CityTransport
,
CityTourism
,
CityOtherStuff
,
CampusTransport
,
CampusAccommodation
,
CampusCultureAndStudentLife
,
CampusOtherStuff
,
CountryDri
,
UniversityDri
,
]
for
model
in
CLASSIC_MODELS
:
admin
.
site
.
register
(
model
)
for
model
in
VERSIONNED_MODELS
:
admin
.
site
.
register
(
model
,
CompareVersionAdmin
)
if
(
model
.
get_serializer
().
Meta
.
model
!=
model
):
raise
Exception
(
"Get_serializer configuration incorrect in"
,
str
(
model
))
raise
Exception
(
"This file should be automatically generated"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment