Commit d8c2cc6a authored by Renán Sosa Guillen's avatar Renán Sosa Guillen

models

parent cf904093
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-21 21:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('catalog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='City',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, max_length=100)),
('city_key', models.CharField(blank=True, max_length=4)),
('coordinates', models.TextField(blank=True, default='', verbose_name='City Coordinates')),
],
),
migrations.CreateModel(
name='State',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, max_length=100)),
('ent_key', models.CharField(blank=True, max_length=4, verbose_name='Entity Key')),
],
),
migrations.AddField(
model_name='city',
name='state',
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='catalog.State'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-21 21:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0002_auto_20180521_2109'),
]
operations = [
migrations.AlterField(
model_name='city',
name='name',
field=models.CharField(blank=True, max_length=50),
),
migrations.AlterField(
model_name='state',
name='name',
field=models.CharField(blank=True, max_length=50),
),
]
......@@ -8,3 +8,15 @@ from django.db import models
class Platform(models.Model):
name = models.CharField(max_length=64)
acronym = models.CharField(max_length=16)
class State(models.Model):
name = models.CharField(max_length=50, blank=True)
ent_key = models.CharField(verbose_name='Entity Key', max_length=4, blank=True)
class City(models.Model):
name = models.CharField(max_length=50, blank=True)
city_key = models.CharField(max_length=4, blank=True)
coordinates = models.TextField(verbose_name='City Coordinates', default='', blank=True)
state = models.ForeignKey(State, on_delete=models.CASCADE, default='')
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
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