diff --git a/doc/ref/index.rst b/doc/ref/index.rst index 5cb5a950fa..1210296611 100644 --- a/doc/ref/index.rst +++ b/doc/ref/index.rst @@ -12,3 +12,4 @@ API Reference pyson transaction tools/singleton + pool diff --git a/doc/ref/pool.rst b/doc/ref/pool.rst new file mode 100644 index 0000000000..d105fb8526 --- /dev/null +++ b/doc/ref/pool.rst @@ -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. diff --git a/doc/topics/models/index.rst b/doc/topics/models/index.rst index 9cd072b0ba..23754de5b3 100644 --- a/doc/topics/models/index.rst +++ b/doc/topics/models/index.rst @@ -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 `. Model instances are essentially accessors to +:ref:`Pool `. Model instances are essentially accessors to records. Model attributes define meta-information of the model. They are class