Skip to content

Commit 75b6db6

Browse files
Nisha ChaubeNisha Chaube
authored andcommitted
📦Add: World API starter code with City schema
1 parent 618a732 commit 75b6db6

15 files changed

+201
-0
lines changed

‎worldapi/__init__.py

Whitespace-only changes.
183 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.
1.3 KB
Binary file not shown.
2.71 KB
Binary file not shown.

‎worldapi/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

‎worldapi/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class WorldapiConfig(AppConfig):
5+
name = 'worldapi'
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Generated by Django 2.1.7 on 2020-10-06 00:23
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
initial = True
10+
11+
dependencies = [
12+
]
13+
14+
operations = [
15+
migrations.CreateModel(
16+
name='City',
17+
fields=[
18+
('city_id', models.AutoField(primary_key=True, serialize=False)),
19+
('city_name', models.CharField(max_length=100)),
20+
('country_code', models.CharField(max_length=100)),
21+
('city_district', models.CharField(max_length=100)),
22+
('city_population', models.IntegerField()),
23+
],
24+
),
25+
migrations.CreateModel(
26+
name='Country',
27+
fields=[
28+
('code', models.CharField(max_length=3, primary_key=True, serialize=False)),
29+
('name', models.CharField(max_length=100)),
30+
('continent', models.CharField(max_length=100)),
31+
('region', models.CharField(max_length=100)),
32+
('indepyear', models.IntegerField()),
33+
('population', models.IntegerField()),
34+
('localname', models.CharField(max_length=100)),
35+
('governmentform', models.CharField(max_length=100)),
36+
('headofstate', models.TextField()),
37+
('capital', models.IntegerField()),
38+
('code2', models.CharField(max_length=2)),
39+
],
40+
),
41+
migrations.CreateModel(
42+
name='CountryLanguage',
43+
fields=[
44+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
45+
('country_language', models.CharField(max_length=50)),
46+
('country_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='worldapi.City')),
47+
],
48+
),
49+
]

‎worldapi/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.

0 commit comments

Comments
 (0)