Skip to content
Browse files

more readme fixes

  • Loading branch information...
1 parent 63cfd72 commit 77add14848565b62569335979dd5c1c47c16d264 @kmike committed Apr 29, 2011
Showing with 19 additions and 10 deletions.
  1. +18 −9 README.rst
  2. +1 −1 slacker/workers/local.py
View
27 README.rst
@@ -41,12 +41,8 @@ Installation
::
- pip install "tornado >= 1.2"
pip install tornado-slacker
-FIXME: this is not uploaded to pypi now
-
-
Slackers
========
@@ -129,13 +125,25 @@ Workers are classes that decides how and where the work should be done:
.. note::
- Django's QuerySet arguments like Q, F objects and aggregate functions
- (e.g. Count) are picklable so tornado-slacker can handle them fine.
+ Django's QuerySet arguments like Q, F objects, aggregate and annotate
+ functions (e.g. Count) are picklable so tornado-slacker can handle
+ them fine::
+
+ AsyncAuthor = Slacker(Author, DjangoWorker())
+
+ # ...
+ qs = AsyncAuthor.objects.filter(
+ Q(name='vasia') or Q(is_great=True)
+ ).values('name').annotate(average_rating=Avg('book__rating'))[:10]
+
+ authors = yield qs.fetch()
Using slacker.Slacker is better than pickling queryset.query
(as adviced at http://docs.djangoproject.com/en/dev/ref/models/querysets/#pickling-querysets)
because this allows to pickle any ORM calls including ones that
- don't return QuerySets (http://docs.djangoproject.com/en/dev/ref/models/querysets/#methods-that-do-not-return-querysets).
+ don't return QuerySets (http://docs.djangoproject.com/en/dev/ref/models/querysets/#methods-that-do-not-return-querysets)::
+
+ yield AsyncUser.objects.create_superuser('foo').fetch()
Moreover, slacker.Slacker adds transparent support for remote invocation
of custom managers and model methods, returning just the model instance
@@ -146,8 +154,9 @@ Contributing
============
If you have any suggestions, bug reports or
-annoyances please report them to the issue tracker
-at https://github.com/kmike/tornado-slacker/issues
+annoyances please report them to the issue tracker:
+
+* https://github.com/kmike/tornado-slacker/issues
Source code:
View
2 slacker/workers/local.py
@@ -14,7 +14,7 @@ class ThreadWorker(object):
.. warning::
- postponed code shouldn't iteract with tornado because
+ postponed code shouldn't interact with tornado because
tornado is not thread-safe.
.. waring::

0 comments on commit 77add14

Please sign in to comment.
Something went wrong with that request. Please try again.