Skip to content

Instantly share code, notes, and snippets.

@eightysteele
Forked from andrewxhill/gist:954622
Created May 4, 2011 02:29
Show Gist options
  • Save eightysteele/954656 to your computer and use it in GitHub Desktop.
Save eightysteele/954656 to your computer and use it in GitHub Desktop.
class OccurrencePolygonSet(db.Model):
# Normal properties...
class Ecoregion(db.Model):
cluster = db.ReferenceProperty(OccurrencePolygonSet)
terms = db.StringListProperty()
# Other properties here...
# Find all ecoregions for a cluster where the ecoregion is introduced and g200Num is 2:
cluster = OccurrencePolygonSet.get(some_key)
Ecoregion.all().filter('cluster =', cluster).filter('terms = introduced').filter('g200Num =', 2).fetch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment