Commit 2001c5ec by Raphael Lullis

Missed a couple of examples that were using 'where' instead of the new 'filter'. Fixed.

parent 529e3d44
...@@ -315,7 +315,7 @@ Most importantly, Querysets can be chained together. This allows you ...@@ -315,7 +315,7 @@ Most importantly, Querysets can be chained together. This allows you
to make more complex queries: to make more complex queries:
~~~~~ {python} ~~~~~ {python}
posts_by_joe = Post.Query.all().where(author='Joe').order_by("view_count") posts_by_joe = Post.Query.all().filter(author='Joe').order_by("view_count")
popular_posts = posts_by_joe.gte(view_count=200) popular_posts = posts_by_joe.gte(view_count=200)
~~~~~ ~~~~~
...@@ -325,7 +325,7 @@ After all the querying/filtering/sorting, you will probably want to do ...@@ -325,7 +325,7 @@ After all the querying/filtering/sorting, you will probably want to do
something with the results. Querysets can be iterated on: something with the results. Querysets can be iterated on:
~~~~~ {python} ~~~~~ {python}
posts_by_joe = Post.Query.all().where(author='Joe').order_by('view_count') posts_by_joe = Post.Query.all().filter(author='Joe').order_by('view_count')
for post in posts_by_joe: for post in posts_by_joe:
print post.title, post.publication_date, post.text print post.title, post.publication_date, post.text
~~~~~ ~~~~~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment