Skip to content

Commit

Permalink
adiciona app com cidades do brasil
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomontefuscolo committed May 27, 2015
1 parent b91b874 commit ce49449
Show file tree
Hide file tree
Showing 10 changed files with 5,692 additions and 0 deletions.
1 change: 1 addition & 0 deletions bikeanjo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.twitter',
'cities',
'cyclists',
'front',
)
Expand Down
Empty file added cities/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions cities/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
32 changes: 32 additions & 0 deletions cities/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
]

operations = [
migrations.CreateModel(
name='City',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=64, verbose_name='Name')),
],
),
migrations.CreateModel(
name='State',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=64, verbose_name='Name')),
],
),
migrations.AddField(
model_name='city',
name='state',
field=models.ForeignKey(to='cities.State'),
),
]
20 changes: 20 additions & 0 deletions cities/migrations/0002_state_acronym.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('cities', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='state',
name='acronym',
field=models.CharField(default='', max_length=4, verbose_name='Acronym'),
preserve_default=False,
),
]
5,618 changes: 5,618 additions & 0 deletions cities/migrations/0003_auto_20150527_1706.py

Large diffs are not rendered by default.

Empty file added cities/migrations/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions cities/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _


class State(models.Model):
name = models.CharField(_('Name'), max_length=64)
acronym = models.CharField(_('Acronym'), max_length=4)


class City(models.Model):
state = models.ForeignKey(State)
name = models.CharField(_('Name'), max_length=64)
3 changes: 3 additions & 0 deletions cities/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions cities/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.

0 comments on commit ce49449

Please sign in to comment.