I have the following 3 classes:
class Locality(db.Model):
location = db.ReferenceProperty()
class Organisation(db.Model):
locality = db.ReferenceProperty(Locality)
class Position(db.Model):
locality = db.ReferenceProperty(Locality)
Locality.location property is reference to Organisation or Position object.
I need to filter by Locality and get all entries with reference to Organisation.
I already tried, but it won’t work:
Locality.all().filter("location =",Organisation)
Any advices will be appreciated.
Finally, I found the solution based on PolyModels:
To get all organisations filtered by geo properties:
To get all localities (organisations + positions) filtered by geo properties:
I guess, my initial explanation was very unclear. Sorry for that. And thank you all, for your advices. They were very useful.