Skip to content

Commit

Permalink
README uses new Filter builder. Resolves #54
Browse files Browse the repository at this point in the history
  • Loading branch information
numberoverzero committed Aug 11, 2016
1 parent 6880e76 commit 1a7d13f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ Query or scan by column values:
email = 'foo@bar.com'
yesterday = arrow.now().replace(days=-1)
account = engine.query(Account.by_email)\
.key(Account.email == email).first()
tweets = engine.query(Tweet)\
.key(Tweet.account == account.id)
acct_query = engine.query(Account.by_email)
acct_query.key = Account.email == email
account = acct_query.first()
for tweet in tweets.filter(Tweet.date >= yesterday):
tweet_query = engine.query(Tweet)
tweet_query.key = Tweet.account == account.id
tweet_query.filter = Tweet.date >= yesterday
for tweet in tweet_query.build():
print(tweet.content)
Expand Down

0 comments on commit 1a7d13f

Please sign in to comment.