Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > t = Transaction.all().filter("client_email =", "some_email").filter("application_id =", "foo").fetch(100)
- > len(t)
- # => 4
- > min = datetime.datetime(2009, 2, 3, 0, 0)
- > max = datetime.datetime(2009, 11, 4, 0, 0)
- > len(Transaction.gql("WHERE client_email =:1 AND date >:2 AND date <=:3 AND application_id =:4",
- "some_email", min, max, "foo").fetch(100))
- # => 2
- > map(lambda x: x.date, t)
- # => [datetime.datetime(2009, 10, 2, 22, 43, 51), datetime.datetime(2009, 10, 5, 2, 5, 24), datetime.datetime(2009, 10, 7, 16, 51, 5), datetime.datetime(2009, 10, 7, 16, 6, 53)]
- > trans = filter(lambda x: x.date < max and x.date >= min, t)
- > len(trans)
- # => 4
Add Comment
Please, Sign In to add comment