Skip to content

Instantly share code, notes, and snippets.

@sahid
Created July 20, 2010 09:30
Show Gist options
  • Save sahid/482738 to your computer and use it in GitHub Desktop.
Save sahid/482738 to your computer and use it in GitHub Desktop.
class User (db.model):
name = db.StringProperty ()
prop = db.IntergerPeroperty ()
class Presence (db.model):
user = db.ReferenceProperty (User)
last = db.DateTimeProperty ()
# Keys users onlines
presences = Presence.all ().filter ('last >', date_considered_connected)
users_onlines = [x.user.key() for x in presences]
# Filters
query = User.all ()
query.filter ('prop1', 1)
# Users online and filtered
users = [x for x in query if query.key () in users_onlines]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment