Permalink
Browse files

merged with master and made python 3.3 compatible

  • Loading branch information...
2 parents 47e4a08 + cbed7a1 commit dcd71a40eb7ca425cf1230920c6f4b6e330e97ea quantmind committed Oct 25, 2012
Showing with 4,240 additions and 1,951 deletions.
  1. +8 −0 CHANGELOG.rst
  2. +16 −11 README.rst
  3. 0 docs/source/{backends/index.rst → api/backends.rst}
  4. +8 −0 docs/source/{model → api}/fields.rst
  5. +25 −0 docs/source/api/index.rst
  6. +65 −24 docs/source/{model → api}/models.rst
  7. +15 −1 docs/source/{backends → api}/redis.rst
  8. +24 −0 docs/source/{ → api}/utility.rst
  9. +1 −4 docs/source/examples/index.rst
  10. +61 −19 docs/source/examples/query.rst
  11. +39 −0 docs/source/examples/sessions.rst
  12. +6 −34 docs/source/index.rst
  13. +0 −38 docs/source/model/index.rst
  14. +0 −20 docs/source/model/search.rst
  15. +0 −83 docs/source/model/session.rst
  16. +3 −3 docs/source/overview.rst
  17. +3 −3 docs/source/stdnetredis.rst
  18. +9 −9 examples/data.py
  19. +15 −14 examples/models.py
  20. +272 −0 examples/redis.lua
  21. +7 −5 lib/hiredis/hiredis.c
  22. +8 −4 lib/hiredis/hiredis.h
  23. +2 −2 lib/src/common.pxd
  24. +4 −5 lib/src/hr.pyx
  25. +9 −5 lib/src/reader.c
  26. +2 −2 lib/src/reader.h
  27. +7 −2 luatests.lua
  28. +1 −3 runtests.py
  29. +2 −2 stdnet/__init__.py
  30. +41 −19 stdnet/apps/columnts/__init__.py
  31. +9 −5 stdnet/apps/columnts/models.py
  32. +4 −1 stdnet/apps/columnts/redis.py
  33. +103 −0 stdnet/apps/pubsub.py
  34. +11 −12 stdnet/apps/searchengine/__init__.py
  35. +44 −26 stdnet/backends/base.py
  36. +13 −13 stdnet/backends/main.py
  37. +181 −240 stdnet/backends/redisb.py
  38. +7 −3 stdnet/lib/__init__.py
  39. +7 −1 stdnet/lib/lua/columnts/columnts.lua
  40. +2 −2 stdnet/lib/lua/columnts/runts.lua
  41. +4 −0 stdnet/lib/lua/columnts/stats.lua
  42. +4 −3 stdnet/lib/lua/commands/utils.lua
  43. +1 −1 stdnet/lib/lua/commands/zdiffstore.lua
  44. 0 stdnet/lib/lua/{odm → }/numberarray.lua
  45. +623 −0 stdnet/lib/lua/odm.lua
  46. +0 −30 stdnet/lib/lua/odm/add_recursive.lua
  47. +0 −87 stdnet/lib/lua/odm/build_query.lua
  48. +0 −186 stdnet/lib/lua/odm/commit_session.lua
  49. +0 −62 stdnet/lib/lua/odm/delete_query.lua
  50. +0 −155 stdnet/lib/lua/odm/load_query.lua
  51. +0 −141 stdnet/lib/lua/redis.lua
  52. +28 −0 stdnet/lib/lua/tabletools.lua
  53. +2 −1 stdnet/lib/redis/__init__.py
  54. +35 −22 stdnet/lib/redis/async.py
  55. +216 −62 stdnet/lib/redis/client.py
  56. +164 −151 stdnet/lib/redis/connection.py
  57. +5 −1 stdnet/lib/redis/exceptions.py
  58. +78 −0 stdnet/lib/redis/pubsub.py
  59. +4 −4 stdnet/lib/redis/redisinfo.py
  60. +25 −14 stdnet/lib/redis/scripts.py
  61. +29 −16 stdnet/odm/base.py
  62. +20 −12 stdnet/odm/fields.py
  63. +3 −1 stdnet/odm/mapper.py
  64. +1 −1 stdnet/odm/models.py
  65. +58 −63 stdnet/odm/query.py
  66. +3 −5 stdnet/odm/related.py
  67. +62 −39 stdnet/odm/search.py
  68. +8 −11 stdnet/odm/session.py
  69. +1 −1 stdnet/odm/struct.py
  70. +11 −9 stdnet/odm/structfields.py
  71. +11 −0 stdnet/test.py
  72. +12 −4 stdnet/utils/__init__.py
  73. +9 −11 stdnet/utils/jsontools.py
  74. +6 −7 stdnet/utils/path.py
  75. +98 −0 tests/lua/odm.lua
  76. +1,146 −0 tests/lua/redis.lua
  77. +0 −33 tests/lua/redis_mock.lua
  78. +35 −0 tests/lua/rserver.lua
  79. +1 −1 tests/lua/utils.lua
  80. +40 −0 tests/regression/backend.py
  81. +5 −6 tests/regression/delete.py
  82. +5 −10 tests/regression/dispatch/dispatcher.py
  83. +5 −3 tests/regression/fields/jsonfield.py
  84. +2 −2 tests/regression/meta.py
  85. +69 −0 tests/regression/pubsub.py
  86. +6 −4 tests/regression/query/get_field.py
  87. +20 −15 tests/regression/query/instruments.py
  88. +9 −14 tests/regression/query/load_only.py
  89. +2 −2 tests/regression/query/manager.py
  90. +8 −10 tests/regression/query/manytomany.py
  91. +122 −0 tests/regression/query/ranges.py
  92. +4 −4 tests/regression/query/related.py
  93. +5 −11 tests/regression/redis/base.py
  94. +31 −33 tests/regression/redis/commands.py
  95. +1 −1 tests/regression/redis/extra.py
  96. +2 −2 tests/regression/redis/info.py
  97. +9 −0 tests/regression/redis/pipeline.py
  98. +69 −15 tests/regression/redis/pool.py
  99. +33 −27 tests/regression/redis/scripting.py
  100. +2 −1 tests/regression/redis/slowlog.py
  101. +13 −5 tests/regression/searchengine.py
  102. +16 −16 tests/regression/session.py
  103. +13 −13 tests/regression/sorting.py
  104. +11 −7 tests/regression/unique.py
  105. +1 −1 tests/regression/utils/tools.py
View
@@ -1,5 +1,13 @@
.. _vers07:
+Ver. 0.7.0 - 2012 Oct 25
+===============================
+* First official release of version 0.7.0. Requires redis_ 2.6 or above.
+* Several fixes in documentation.
+* Implemented :ref:`field lookups <field-lookups>` ``gt``, ``gt``, ``lt`` and ``le``.
+* Added a *prefixed* redis client in :class:`stdnet.lib.redis.PrefixedRedis`.
+* **624 regression tests** with **92%** coverage.
+
Ver. 0.7c6 - 2012 Sep 10
===============================
* **Tested with redis 2.6.0-rc6**.
View
@@ -7,7 +7,6 @@ The `source code`__ and documentation__ are hosted at github while Downloads__ a
:Documentation: http://lsbardel.github.com/python-stdnet/
:Dowloads: http://pypi.python.org/pypi/python-stdnet/
:Source: https://github.com/lsbardel/python-stdnet
-:Issues: https://github.com/lsbardel/python-stdnet/issues
:Mailing List: https://groups.google.com/group/python-stdnet
:Keywords: server, database, cache, redis, odm
@@ -24,11 +23,21 @@ Contents
:local:
+Features
+=================
+* Models with scalar and multi-value fields.
+* Reach query API including unions, intersections, exclusions, ranges and more.
+* Full text search.
+* Multi-variate numeric timeseries application.
+* Publish/Subscribe application.
+
Requirements
=================
* Python 2.6 to Python 3.3. Single codebase.
+* You need access to a Redis_ server version 2.6 or above.
* Optional Cython_ for faster redis protocol parser.
-* You need access to a Redis_ server.
+* Optional pulsar_ only when using the asynchronous redis connection or the
+ test suite.
Philosophy
@@ -61,13 +70,6 @@ or ``pip``::
pip install python-stdnet
-
-Documentation
-============================
-StdNet uses Sphinx_ for its documentation, and the latest is available at GitHub:
-
-* http://lsbardel.github.com/python-stdnet/
-
Version Check
======================
@@ -167,7 +169,8 @@ Requirements for running tests:
* unittest2_ for python 2.6 only.
* argparse_ for python 2.6, 3 and 3.1 only.
-* nose_
+* mock_ for python 2.6 to python 3.2 only.
+* nose_ or pulsar_.
Note, these requirements are only needed if you are planning to run tests.
To run tests open a shell and launch Redis. On another shell,
@@ -241,4 +244,6 @@ file in the top distribution directory for the full license text.
.. _argparse: http://pypi.python.org/pypi/argparse
.. _unittest2: http://pypi.python.org/pypi/unittest2
.. _nose: http://readthedocs.org/docs/nose/en/latest
-.. _DynamoDB: http://aws.amazon.com/dynamodb/
+.. _DynamoDB: http://aws.amazon.com/dynamodb/
+.. _pulsar: http://pypi.python.org/pypi/pulsar
+.. _mock: http://pypi.python.org/pypi/mock
File renamed without changes.
@@ -234,6 +234,14 @@ HashField
.. autoclass:: HashField
:members:
:member-order: bysource
+
+
+TimeSeriesField
+~~~~~~~~~~~~~~~~~~~~~~~
+
+.. autoclass:: TimeSeriesField
+ :members:
+ :member-order: bysource
.. _model-field-descriptors:
View
@@ -0,0 +1,25 @@
+.. _model-index:
+
+.. module:: stdnet.odm
+
+============================
+API
+============================
+
+Stdnet is an object data mapper for non-relational databases or nosql_ as
+they are known. It is also a lightweight module, which deal only with data mapping,
+advanced queries and nothing else.
+
+
+**Contents**
+
+.. toctree::
+ :maxdepth: 2
+
+ models
+ fields
+ backends
+ utility
+
+
+.. _nosql: http://nosql-database.org/
@@ -6,6 +6,14 @@
Model and Query API
============================
+The *object-data mapper* (ODM) is the core of the library. It defines an API for mapping
+data in the backend key-value store to objects in Python.
+It'is name is closely related to
+`object relational Mapping <http://en.wikipedia.org/wiki/Object-relational_mapping>`_ (ORM),
+a programming technique for converting data between incompatible
+type systems in traditional `relational databases <http://en.wikipedia.org/wiki/Relational_database>`_
+and object-oriented programming languages.
+
Model
==================
@@ -81,6 +89,14 @@ QueryElement
:member-order: bysource
+SearchEngine Interface
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. autoclass:: SearchEngine
+ :members:
+ :member-order: bysource
+
+
.. _model-structures:
Data Structures
@@ -212,6 +228,52 @@ TS
:member-order: bysource
+Session and Managers
+=========================
+
+Session
+~~~~~~~~~~~~~~~
+
+.. autoclass:: Session
+ :members:
+ :member-order: bysource
+
+Session Model
+~~~~~~~~~~~~~~~
+
+.. autoclass:: SessionModel
+ :members:
+ :member-order: bysource
+
+Transaction
+~~~~~~~~~~~~~~~
+
+.. autoclass:: Transaction
+ :members:
+ :member-order: bysource
+
+Manager
+~~~~~~~~~~~~~~~~~~
+.. autoclass:: Manager
+ :members:
+ :member-order: bysource
+
+
+RelatedManager
+~~~~~~~~~~~~~~~~~~
+
+.. autoclass:: stdnet.odm.related.RelatedManager
+ :members:
+ :member-order: bysource
+
+One2ManyRelatedManager
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. autoclass:: stdnet.odm.related.One2ManyRelatedManager
+ :members:
+ :member-order: bysource
+
+
.. _register-model:
@@ -255,28 +317,7 @@ Unregister model
.. autofunction:: unregister
-.. _signal-api:
-
-Signals
-=====================
-Stdnet includes a signal dispatcher which helps allow decoupled
-applications get notified when actions occur elsewhere in the framework.
-In a nutshell, signals allow certain senders to notify a set of receivers
-that some action has taken place.
-They are especially useful when many pieces of code may be interested in
-the same events.
-
-The data mapper provide with the following built-in signals in the :mod:`stdnet.odm`
-module:
-
-* ``pre_commit`` triggered before new instances or changes on existing instances
- are committed to the backend server.
-* ``post_commit`` triggered after new instances or changes on existing instances
- are committed to the backend server.
-
-It is also possible to add callback to single instances in the following way::
-
- instance = MyModel(...)
- instance.post_commit(callable)
-.. _standard template library: http://www.sgi.com/tech/stl/
+.. _standard template library: http://www.sgi.com/tech/stl/
+.. _SQLAlchemy: http://www.sqlalchemy.org/
+.. _Django: http://docs.djangoproject.com/en/dev/ref/models/instances/
@@ -137,8 +137,22 @@ Redis
.. autoclass:: Redis
:members:
:member-order: bysource
-
+
+RedisProxy
+~~~~~~~~~~~~~~~~
+.. autoclass:: RedisProxy
+ :members:
+ :member-order: bysource
+
+
+PrefixedRedis
+~~~~~~~~~~~~~~~~
+.. autoclass:: PrefixedRedis
+ :members:
+ :member-order: bysource
+
+
Pipeline
~~~~~~~~~~~~~~~
.. autoclass:: Pipeline
@@ -177,6 +177,30 @@ Exceptions
:member-order: bysource
+.. _signal-api:
+
+Signals
+=====================
+Stdnet includes a signal dispatcher which helps allow decoupled
+applications get notified when actions occur elsewhere in the framework.
+In a nutshell, signals allow certain senders to notify a set of receivers
+that some action has taken place.
+They are especially useful when many pieces of code may be interested in
+the same events.
+
+The data mapper provide with the following built-in signals in the :mod:`stdnet.odm`
+module:
+
+* ``pre_commit`` triggered before new instances or changes on existing instances
+ are committed to the backend server.
+* ``post_commit`` triggered after new instances or changes on existing instances
+ are committed to the backend server.
+
+It is also possible to add callback to single instances in the following way::
+
+ instance = MyModel(...)
+ instance.post_commit(callable)
+
Miscellaneous
============================
@@ -14,10 +14,6 @@ advanced configuration parameters and functionalities can be investigated.
The collection of tutorials examples is available in the
:mod:`examples` module in the source distribution.
-They illustrate the use of the different :ref:`scalar <model-field>`
-and :ref:`data structure <model-field-structure>` fields
-available in :mod:`stdnet`.
-
**Tutorials**
.. toctree::
@@ -27,5 +23,6 @@ available in :mod:`stdnet`.
query
sorting
search
+ sessions
performance
twitter
Oops, something went wrong.

0 comments on commit dcd71a4

Please sign in to comment.