Skip to content
GitLab
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
11a6fd82
Commit
11a6fd82
authored
Aug 21, 2018
by
Florent Chehab
Browse files
CountryTourism added
parent
9e062621
Changes
6
Hide whitespace changes
Inline
Side-by-side
docs/UML/CountryModules.pu
View file @
11a6fd82
...
...
@@ -11,6 +11,7 @@ package CountryModule{
class
OtherInsurance
class
CountryOtherStuff
class
CountryTransport
class
CountryTourism
class
CountryPhoto
class
ScholarshipCountry
...
...
@@ -22,6 +23,7 @@ package CountryModule{
HealthInsurance
-
up
-|>
BasicModuleCopyCountry
CountryOtherStuff
-
up
-|>
BasicModuleCopyCountry
CountryTransport
-
up
-|>
BasicModuleCopyCountry
CountryTourism
-
up
-|>
BasicModuleCopyCountry
CountryPhoto
-
up
-|>
PhotoCopyCountry
...
...
@@ -36,6 +38,7 @@ package CountryModule{
OtherInsurance
"1"
-
down
[
bold
,#
green
]-
"1"
CountryVirtualCopy
CountryOtherStuff
"1"
-
down
[
bold
,#
green
]-
"1"
CountryVirtualCopy
CountryTransport
"1"
-
down
[
bold
,#
green
]-
"1"
CountryVirtualCopy
CountryTourism
"1"
-
down
[
bold
,#
green
]-
"1"
CountryVirtualCopy
CountryPhoto
"1"
-
down
[
bold
,#
green
]-
"1"
CountryVirtualCopy
ScholarshipCountry
"*"
-
down
-
"*"
CountryVirtualCopy
...
...
rex/admin.py
View file @
11a6fd82
...
...
@@ -7,6 +7,7 @@ from rex.models.location import CountryCulture
from
rex.models.location
import
CountryHealthInsurance
from
rex.models.location
import
CountryOtherInsurance
from
rex.models.location
import
CountryTransport
from
rex.models.location
import
CountryTourism
from
rex.models.location
import
CountryOtherStuff
from
rex.models.location
import
CountryVisaAdministrative
from
rex.models.location
import
CountryPhoto
...
...
@@ -47,6 +48,7 @@ VERSIONNED_MODELS = [
CountryHealthInsurance
,
CountryOtherInsurance
,
CountryTransport
,
CountryTourism
,
CountryOtherStuff
,
CountryVisaAdministrative
,
CountryPhoto
,
...
...
rex/migrations/0021_countrytourism.py
0 → 100644
View file @
11a6fd82
# Generated by Django 2.0.3 on 2018-08-21 13:06
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
rex.models.tools.usefullLinksField
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rex'
,
'0020_auto_20180821_1451'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'CountryTourism'
,
fields
=
[
(
'comment'
,
models
.
TextField
(
blank
=
True
)),
(
'usefull_links'
,
rex
.
models
.
tools
.
usefullLinksField
.
UsefullLinksField
(
blank
=
True
,
default
=
[],
validators
=
[
rex
.
models
.
tools
.
usefullLinksField
.
validate_usefull_links
])),
(
'country'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
primary_key
=
True
,
related_name
=
'country_tourism'
,
serialize
=
False
,
to
=
'rex.Country'
)),
],
options
=
{
'abstract'
:
False
,
},
),
]
rex/models/location/__init__.py
View file @
11a6fd82
...
...
@@ -6,6 +6,7 @@ from .countryBasicModules import CountryVisaAdministrative, CountryVisaAdministr
from
.countryBasicModules
import
CountryHealthInsurance
,
CountryHealthInsuranceViewSet
# noqa: F401
from
.countryBasicModules
import
CountryOtherInsurance
,
CountryOtherInsuranceViewSet
# noqa: F401
from
.countryBasicModules
import
CountryTransport
,
CountryTransportViewSet
# noqa: F401
from
.countryBasicModules
import
CountryTourism
,
CountryTourismViewSet
# noqa: F401
from
.countryBasicModules
import
CountryOtherStuff
,
CountryOtherStuffViewSet
# noqa: F401
from
.countryPhoto
import
CountryPhoto
,
CountryPhotoViewSet
# noqa: F401
from
.countryScholarship
import
CountryScholarship
,
CountryScholarshipViewSet
# noqa: F401
rex/models/location/countryBasicModules.py
View file @
11a6fd82
...
...
@@ -132,6 +132,31 @@ class CountryTransportViewSet(viewsets.ModelViewSet): # TODO switch to dict
#####################
####################
# CountryTourism
###################
class
CountryTourism
(
BasicModule
):
country
=
models
.
OneToOneField
(
Country
,
on_delete
=
models
.
CASCADE
,
related_name
=
'country_tourism'
,
primary_key
=
True
)
class
CountryTourismSerializer
(
BasicModuleSerializer
):
class
Meta
:
model
=
CountryTourism
fields
=
'__all__'
class
CountryTourismViewSet
(
viewsets
.
ModelViewSet
):
# TODO switch to dict
permission_classes
=
(
permissions
.
DjangoModelPermissions
,)
queryset
=
CountryTourism
.
objects
.
all
()
# pylint: disable=E1101
serializer_class
=
CountryTourismSerializer
#####################
#####################
####################
# CountryOtherStuff
###################
...
...
rex/urls.py
View file @
11a6fd82
...
...
@@ -8,6 +8,7 @@ from rex.models.location import CountryCultureViewSet
from
rex.models.location
import
CountryHealthInsuranceViewSet
from
rex.models.location
import
CountryOtherInsuranceViewSet
from
rex.models.location
import
CountryTransportViewSet
from
rex.models.location
import
CountryTourismViewSet
from
rex.models.location
import
CountryOtherStuffViewSet
from
rex.models.location
import
CountryVisaAdministrativeViewSet
from
rex.models.location
import
CountryPhotoViewSet
...
...
@@ -48,6 +49,7 @@ router.register(r'country_more/health_insurance',
CountryHealthInsuranceViewSet
)
router
.
register
(
r
'country_more/other_insurance'
,
CountryOtherInsuranceViewSet
)
router
.
register
(
r
'country_more/transport'
,
CountryTransportViewSet
)
router
.
register
(
r
'country_more/transport'
,
CountryTourismViewSet
)
router
.
register
(
r
'country_more/other_stuff'
,
CountryOtherStuffViewSet
)
router
.
register
(
r
'country_more/visa_administrative'
,
CountryVisaAdministrativeViewSet
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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