Commit ef93ef29 authored by Florent Chehab's avatar Florent Chehab

flake8 in location.py

parent c1914a04
Pipeline #26280 passed with stages
in 1 minute and 46 seconds
from django.db import models
from rest_framework import serializers, viewsets, permissions
from rest_framework import serializers, permissions
from rex.models.tools import DictModeViewSet
# Data model based on : https://unstats.un.org/unsd/methodology/m49/overview/
......@@ -8,13 +8,16 @@ from rex.models.tools import DictModeViewSet
class Country(models.Model):
name = models.CharField(max_length=200)
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_un_code = models.CharField(max_length=3)
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)
intermediate_region_name = models.CharField(max_length=200, null=True, blank=True)
intermediate_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_un_code = models.CharField(
max_length=3, null=True, blank=True)
class City(models.Model):
......@@ -30,6 +33,7 @@ class City(models.Model):
API RELATED STUFF BELLOW
"""
class CountrySerializer(serializers.ModelSerializer):
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