Add missing documentation for Pool

review330001
This commit is contained in:
Cédric Krier
2012-04-21 01:21:41 +02:00
parent e4688b9360
commit d129ef57ea
3 changed files with 46 additions and 1 deletions
+1
View File
@@ -12,3 +12,4 @@ API Reference
pyson
transaction
tools/singleton
pool
+44
View File
@@ -0,0 +1,44 @@
.. _ref-pool:
.. module:: trytond.pool
====
Pool
====
.. class:: Pool([database_name])
The Pool store the instances of models, wizards and reports per database.
Static methods:
.. staticmethod:: Pool.register(klass[, type])
Register a class of type (default: `model`).
Class methods:
.. classmethod:: Pool.start()
Start the pool by registering all Tryton modules found.
.. classmethod:: Pool.stop(database_name)
Stop the pool by removing instances for the database.
.. classmethod:: Pool.database_list()
List all started database.
Instance methods:
.. method:: Pool.get(name[, type])
Return the named instance of type from the pool.
.. method:: Pool.object_name_list([type])
Return the list of instances names.
.. method:: Pool.iterobject([type])
Return an interator over instances names.
+1 -1
View File
@@ -37,7 +37,7 @@ fields::
Instantiating the class registers the model class in the framework. Later the
class will be instantiated once per database and stored in the
:ref:`Pool <topics-pool>`. Model instances are essentially accessors to
:ref:`Pool <ref-pool>`. Model instances are essentially accessors to
records.
Model attributes define meta-information of the model. They are class