Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Whitespace

  • Loading branch information...
commit 35aa4edcad250b8c25aa48e9671a426831f95f82 1 parent eeeefc9
@coleifer authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 README.rst
View
12 README.rst
@@ -19,22 +19,22 @@ Examples::
# a simple query selecting a user
User.get(User.username == 'charles')
-
+
# get the staff and super users
editors = User.select().where(
(User.is_staff == True) |
(User.is_superuser == True)
)
-
+
# get tweets by editors ("<<" maps to IN)
Tweet.select().where(Tweet.user << editors)
-
+
# how many active users are there?
User.select().where(User.active == True).count()
-
+
# paginate the user table and show me page 3 (users 41-60)
User.select().order_by(User.username).paginate(3, 20)
-
+
# order users by number of tweets
User.select().annotate(Tweet).order_by(
fn.Count(Tweet.id).desc()
@@ -44,7 +44,7 @@ Examples::
User.select(
User, fn.Count(Tweet.id).alias('ct')
).join(Tweet).group_by(User).order_by(R('ct desc'))
-
+
# do an atomic update
Counter.update(count=Counter.count + 1).where(
Counter.url == request.url
Please sign in to comment.
Something went wrong with that request. Please try again.