Commit 11a6fd82 authored by Florent Chehab's avatar Florent Chehab
Browse files

CountryTourism added

parent 9e062621
...@@ -11,6 +11,7 @@ package CountryModule{ ...@@ -11,6 +11,7 @@ package CountryModule{
class OtherInsurance class OtherInsurance
class CountryOtherStuff class CountryOtherStuff
class CountryTransport class CountryTransport
class CountryTourism
class CountryPhoto class CountryPhoto
class ScholarshipCountry class ScholarshipCountry
...@@ -22,6 +23,7 @@ package CountryModule{ ...@@ -22,6 +23,7 @@ package CountryModule{
HealthInsurance -up-|> BasicModuleCopyCountry HealthInsurance -up-|> BasicModuleCopyCountry
CountryOtherStuff -up-|> BasicModuleCopyCountry CountryOtherStuff -up-|> BasicModuleCopyCountry
CountryTransport -up-|> BasicModuleCopyCountry CountryTransport -up-|> BasicModuleCopyCountry
CountryTourism -up-|> BasicModuleCopyCountry
CountryPhoto -up-|> PhotoCopyCountry CountryPhoto -up-|> PhotoCopyCountry
...@@ -36,6 +38,7 @@ package CountryModule{ ...@@ -36,6 +38,7 @@ package CountryModule{
OtherInsurance "1" -down[bold,#green]- "1" CountryVirtualCopy OtherInsurance "1" -down[bold,#green]- "1" CountryVirtualCopy
CountryOtherStuff "1" -down[bold,#green]- "1" CountryVirtualCopy CountryOtherStuff "1" -down[bold,#green]- "1" CountryVirtualCopy
CountryTransport "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 CountryPhoto "1" -down[bold,#green]- "1" CountryVirtualCopy
ScholarshipCountry "*" -down- "*" CountryVirtualCopy ScholarshipCountry "*" -down- "*" CountryVirtualCopy
......
...@@ -7,6 +7,7 @@ from rex.models.location import CountryCulture ...@@ -7,6 +7,7 @@ from rex.models.location import CountryCulture
from rex.models.location import CountryHealthInsurance from rex.models.location import CountryHealthInsurance
from rex.models.location import CountryOtherInsurance from rex.models.location import CountryOtherInsurance
from rex.models.location import CountryTransport from rex.models.location import CountryTransport
from rex.models.location import CountryTourism
from rex.models.location import CountryOtherStuff from rex.models.location import CountryOtherStuff
from rex.models.location import CountryVisaAdministrative from rex.models.location import CountryVisaAdministrative
from rex.models.location import CountryPhoto from rex.models.location import CountryPhoto
...@@ -47,6 +48,7 @@ VERSIONNED_MODELS = [ ...@@ -47,6 +48,7 @@ VERSIONNED_MODELS = [
CountryHealthInsurance, CountryHealthInsurance,
CountryOtherInsurance, CountryOtherInsurance,
CountryTransport, CountryTransport,
CountryTourism,
CountryOtherStuff, CountryOtherStuff,
CountryVisaAdministrative, CountryVisaAdministrative,
CountryPhoto, CountryPhoto,
......
# 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,
},
),
]
...@@ -6,6 +6,7 @@ from .countryBasicModules import CountryVisaAdministrative, CountryVisaAdministr ...@@ -6,6 +6,7 @@ from .countryBasicModules import CountryVisaAdministrative, CountryVisaAdministr
from .countryBasicModules import CountryHealthInsurance, CountryHealthInsuranceViewSet # noqa: F401 from .countryBasicModules import CountryHealthInsurance, CountryHealthInsuranceViewSet # noqa: F401
from .countryBasicModules import CountryOtherInsurance, CountryOtherInsuranceViewSet # noqa: F401 from .countryBasicModules import CountryOtherInsurance, CountryOtherInsuranceViewSet # noqa: F401
from .countryBasicModules import CountryTransport, CountryTransportViewSet # noqa: F401 from .countryBasicModules import CountryTransport, CountryTransportViewSet # noqa: F401
from .countryBasicModules import CountryTourism, CountryTourismViewSet # noqa: F401
from .countryBasicModules import CountryOtherStuff, CountryOtherStuffViewSet # noqa: F401 from .countryBasicModules import CountryOtherStuff, CountryOtherStuffViewSet # noqa: F401
from .countryPhoto import CountryPhoto, CountryPhotoViewSet # noqa: F401 from .countryPhoto import CountryPhoto, CountryPhotoViewSet # noqa: F401
from .countryScholarship import CountryScholarship, CountryScholarshipViewSet # noqa: F401 from .countryScholarship import CountryScholarship, CountryScholarshipViewSet # noqa: F401
...@@ -132,6 +132,31 @@ class CountryTransportViewSet(viewsets.ModelViewSet): # TODO switch to dict ...@@ -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 # CountryOtherStuff
################### ###################
......
...@@ -8,6 +8,7 @@ from rex.models.location import CountryCultureViewSet ...@@ -8,6 +8,7 @@ from rex.models.location import CountryCultureViewSet
from rex.models.location import CountryHealthInsuranceViewSet from rex.models.location import CountryHealthInsuranceViewSet
from rex.models.location import CountryOtherInsuranceViewSet from rex.models.location import CountryOtherInsuranceViewSet
from rex.models.location import CountryTransportViewSet from rex.models.location import CountryTransportViewSet
from rex.models.location import CountryTourismViewSet
from rex.models.location import CountryOtherStuffViewSet from rex.models.location import CountryOtherStuffViewSet
from rex.models.location import CountryVisaAdministrativeViewSet from rex.models.location import CountryVisaAdministrativeViewSet
from rex.models.location import CountryPhotoViewSet from rex.models.location import CountryPhotoViewSet
...@@ -48,6 +49,7 @@ router.register(r'country_more/health_insurance', ...@@ -48,6 +49,7 @@ router.register(r'country_more/health_insurance',
CountryHealthInsuranceViewSet) CountryHealthInsuranceViewSet)
router.register(r'country_more/other_insurance', CountryOtherInsuranceViewSet) router.register(r'country_more/other_insurance', CountryOtherInsuranceViewSet)
router.register(r'country_more/transport', CountryTransportViewSet) 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/other_stuff', CountryOtherStuffViewSet)
router.register(r'country_more/visa_administrative', router.register(r'country_more/visa_administrative',
CountryVisaAdministrativeViewSet) CountryVisaAdministrativeViewSet)
......
Markdown is supported
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