Skip to content

Instantly share code, notes, and snippets.

@andrewxhill
Created May 4, 2011 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewxhill/956273 to your computer and use it in GitHub Desktop.
Save andrewxhill/956273 to your computer and use it in GitHub Desktop.
class OccurrenceSetIndex(db.Model): #parent = OccurrenceSet see below
term = db.CategoryProperty() #string values to search for sets
rank = db.RatingProperty(default=0) #weight of term for an order by
class OccurrenceSet(db.Model): #key_name = ecoregion/wwf/puma_concolor or something
name = db.StringProperty() #this could be non-unique, Puma concolor is fine
source = db.StringProperty() #wwf
type = db.StringProperty() #ecoregion
info = db.BlobProperty() #some meta standard for sets of occ polygons
dateCreated = db.DateTimeProperty(auto_now_add=True)
class OccurrenceIndex(db.Model): #parent = OccurrencePolygon see below
occurrenceSet = db.StringProperty() #key_name string
introduced = db.BooleanProperty(default=None)
set = db.ReferenceProperty(OccurrenceSet, collection_name="polygons") #OccurrenceSet
class MultiPolygonIndex(db.Model): #parent = OccurrenceSet see below
term = db.CategoryProperty() #string values to search for sets
rank = db.RatingProperty(default=0) #weight of term for an order by
class MultiPolygon(db.Model): #key_name = some_id
name = db.StringProperty()
type = db.CategoryProperty() #'ecoregion' would be one
source = db.CategoryProperty() #'wwf' would be one
info = db.BlobProperty() #some meta standard based on the type, but not restriced by the datastore model
dateCreated = db.DateTimeProperty(auto_now_add=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment