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

flake8 in location.py

parent c1914a04
from django.db import models from django.db import models
from rest_framework import serializers, viewsets, permissions from rest_framework import serializers, permissions
from rex.models.tools import DictModeViewSet from rex.models.tools import DictModeViewSet
# Data model based on : https://unstats.un.org/unsd/methodology/m49/overview/ # Data model based on : https://unstats.un.org/unsd/methodology/m49/overview/
...@@ -8,13 +8,16 @@ from rex.models.tools import DictModeViewSet ...@@ -8,13 +8,16 @@ from rex.models.tools import DictModeViewSet
class Country(models.Model): class Country(models.Model):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
iso_alpha2_code = models.CharField(primary_key=True, max_length=2) iso_alpha2_code = models.CharField(primary_key=True, max_length=2)
iso_alpha3_code = models.CharField(unique=True, max_length=3, blank=False, null=False) iso_alpha3_code = models.CharField(
unique=True, max_length=3, blank=False, null=False)
region_name = models.CharField(max_length=200) region_name = models.CharField(max_length=200)
region_un_code = models.CharField(max_length=3) region_un_code = models.CharField(max_length=3)
sub_region_name = models.CharField(max_length=200, null=True, blank=True) sub_region_name = models.CharField(max_length=200, null=True, blank=True)
sub_region_un_code = models.CharField(max_length=3, null=True, blank=True) sub_region_un_code = models.CharField(max_length=3, null=True, blank=True)
intermediate_region_name = models.CharField(max_length=200, null=True, blank=True) intermediate_region_name = models.CharField(
intermediate_region_un_code = models.CharField(max_length=3, null=True, blank=True) max_length=200, null=True, blank=True)
intermediate_region_un_code = models.CharField(
max_length=3, null=True, blank=True)
class City(models.Model): class City(models.Model):
...@@ -30,6 +33,7 @@ class City(models.Model): ...@@ -30,6 +33,7 @@ class City(models.Model):
API RELATED STUFF BELLOW API RELATED STUFF BELLOW
""" """
class CountrySerializer(serializers.ModelSerializer): class CountrySerializer(serializers.ModelSerializer):
class Meta: class Meta:
......
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