forked from newsapps/django-boundaryservice
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James McKinney
committed
Nov 29, 2014
1 parent
ade98dd
commit d9abae4
Showing
6 changed files
with
44 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
import jsonfield.fields | ||
|
||
|
||
def set_defaults(apps, schema_editor): | ||
Boundary = apps.get_model("boundaries", "Boundary") | ||
for boundary in Boundary.objects.all(): | ||
if boundary.metadata is None: | ||
boundary.metadata = {} | ||
boundary.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('boundaries', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(set_defaults), | ||
migrations.AlterField( | ||
model_name='boundary', | ||
name='metadata', | ||
field=jsonfield.fields.JSONField(default={}, help_text='The attributes of the boundary from the shapefile, as a dictionary.'), | ||
), | ||
migrations.AlterField( | ||
model_name='boundaryset', | ||
name='extra', | ||
field=jsonfield.fields.JSONField(default={}, help_text='Any additional metadata.'), | ||
), | ||
] |
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
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