Skip to content

Commit

Permalink
add fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Jun 27, 2014
1 parent f32e591 commit 5a12328
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions boundaries/management/commands/loadshapefiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def load_set_2(self, slug, config, options, datasources):
source_url=config.get('source_url', ''),
notes=config.get('notes', ''),
licence_url=config.get('licence_url', ''),
start_date=config.get('start_date', None),
end_date=config.get('end_date', None),
# Load from either the 'extra' or 'metadata' fields
extra=config.get('extra', config.get('metadata', None))
)
Expand Down
6 changes: 5 additions & 1 deletion boundaries/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class BoundarySet(models.Model):
help_text='The URL to the text of the licence this data is distributed under')
extent = JSONField(blank=True, null=True,
help_text='The bounding box of the boundaries in EPSG:4326 projection, as a list such as [xmin, ymin, xmax, ymax].')
start_date = models.DateField(
help_text='The date on which this set of boundaries went into effect.', null=True)
end_date = models.DateField(
help_text='The date on which this set of boundaries was superceded.', null=True)
extra = JSONField(blank=True, null=True,
help_text="Any other nonstandard metadata provided when creating this boundary set.")

Expand All @@ -94,7 +98,7 @@ def __str__(self):
name_plural = property(lambda s: s.name)
name_singular = property(lambda s: s.singular)

api_fields = ('name_plural', 'name_singular', 'authority', 'domain', 'source_url', 'notes', 'licence_url', 'last_updated', 'extent', 'extra')
api_fields = ('name_plural', 'name_singular', 'authority', 'domain', 'source_url', 'notes', 'licence_url', 'last_updated', 'extent', 'extra', 'start_date', 'end_date')
api_fields_doc_from = { 'name_plural': 'name', 'name_singular': 'singular' }

def as_dict(self):
Expand Down

0 comments on commit 5a12328

Please sign in to comment.