Created
July 20, 2010 09:30
-
-
Save sahid/482738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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