jj0hns0n / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
http://geonode.org/
GNU General Public License v3.0
3 stars 0 forks source link

Join Targets: Add Category #31

Closed raprasad closed 9 years ago

raprasad commented 9 years ago

For the "JoinTarget" model, add a Category field.

from django.utils.text import slugify

CATEGORIES = ('Census Tract', 'Census Block', 'Census Block Group', ...)
CATEGORY_CHOICES = [ (slugify(x.upper()), x) for x in CATEGORIES]

class JoinTarget(models.Model):
    ...
    category = models.CharField(max_length=100, choices=CATEGORY_CHOICES)

Categories should be standard geospatial identifiers and preferably have a format that may be machine-validated. (e.g. A Census Tract is 6 digits--zero-padded, etc.)