Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #47 from geonu/patch-1
Browse files Browse the repository at this point in the history
Improve readability of README by code highlight
  • Loading branch information
stevearc committed Oct 19, 2016
2 parents ec9a525 + 7d741a8 commit 971aeed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.rst
Expand Up @@ -18,7 +18,7 @@ This is what a basic model looks like (schema taken from this `DynamoDB
API documentation
<http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html>`_)

::
.. sourcecode:: python

from flywheel import Model, Field, GlobalIndex

Expand All @@ -41,7 +41,7 @@ API documentation

Create a new top score

::
.. sourcecode:: python

>>> score = GameScore('Master Blaster', 'abc')
>>> score.top_score = 9001
Expand All @@ -50,28 +50,28 @@ Create a new top score

Get all top scores for a user

::
.. sourcecode:: python

>>> scores = engine.query(GameScore).filter(userid='abc').all()

Get the top score for Galaxy Invaders

::
.. sourcecode:: python

>>> top_score = engine.query(GameScore).filter(title='Galaxy Invaders')\
... .first(desc=True)

Atomically increment a user's "wins" count on Alien Adventure

::
.. sourcecode:: python

>>> score = GameScore('Alien Adventure', 'abc')
>>> score.incr_(wins=1)
>>> engine.sync(score)

Get all scores on Comet Quest that are over 9000

::
.. sourcecode:: python

>>> scores = engine.query(GameScore).filter(GameScore.top_score > 9000,
... title='Comet Quest').all()

0 comments on commit 971aeed

Please sign in to comment.