-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from raphaelmerx/example_migrate
Migrate the example to Django 1.10
- Loading branch information
Showing
9 changed files
with
120 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.12 on 2017-02-25 01:13 | ||
from __future__ import unicode_literals | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import localflavor.us.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='City', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=200)), | ||
('state', localflavor.us.models.USStateField(max_length=2)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Farm', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=200)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Fruit', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=200)), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='farm', | ||
name='fruit', | ||
field=models.ManyToManyField(to='core.Fruit'), | ||
), | ||
migrations.AddField( | ||
model_name='farm', | ||
name='owner', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='farms', to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 migrations | ||
from django.core.management import call_command | ||
|
||
|
||
def load_initial_data(apps, schema_editor): | ||
call_command('loaddata', 'initial_data', app_label='core') | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0001_initial') | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(load_initial_data), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
from django.conf.urls import patterns, include, url | ||
from django.conf.urls import include, url | ||
|
||
from .views import formset, advanced, index | ||
|
||
urlpatterns = patterns('core.views', | ||
url(r'^formset/', 'formset', name='example-formset'), | ||
url(r'^advanced/', 'advanced', name='example-advanced'), | ||
url(r'^', 'index', name='example-index'), | ||
) | ||
urlpatterns = [ | ||
url(r'^formset/', formset, name='example-formset'), | ||
url(r'^advanced/', advanced, name='example-advanced'), | ||
url(r'^', index, name='example-index'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
from django.conf.urls import patterns, include, url | ||
from django.conf.urls import include, url | ||
|
||
# Uncomment the next two lines to enable the admin: | ||
from django.contrib import admin | ||
admin.autodiscover() | ||
|
||
urlpatterns = patterns('', | ||
urlpatterns = [ | ||
# Uncomment the admin/doc line below to enable admin documentation: | ||
# (r'^admin/doc/', include('django.contrib.admindocs.urls')), | ||
|
||
# Uncomment the next line to enable the admin: | ||
(r'^admin/', include(admin.site.urls)), | ||
(r'^selectable/', include('selectable.urls')), | ||
(r'^', include('core.urls')), | ||
) | ||
url(r'^admin/', include(admin.site.urls)), | ||
url(r'^selectable/', include('selectable.urls')), | ||
url(r'^', include('core.urls')), | ||
] |
Empty file.