summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-03-23 13:21:26 +0100
committerXavier Morel <xmo@openerp.com>2011-03-23 13:21:26 +0100
commit1d587145de0bfad76db50b5e2a96a659ad42e032 (patch)
tree680721fbca4d10d0ba4c28bdf2ad8efa3ff42dbf
parent801fae18ca92eecd9f6febcc15ec4f3ee0887cc4 (diff)
[IMP] fix docstrings on DataSet, insert into internal APIdoc (and fix documentation PYTHONPATH to generate this correctly)
bzr revid: xmo@openerp.com-20110323122126-3qj7vkhjsc6l0x5x
-rw-r--r--addons/base/controllers/main.py23
-rw-r--r--doc/source/conf.py3
-rw-r--r--doc/source/development.rst9
3 files changed, 33 insertions, 2 deletions
diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py
index 723b0ae39dc..58dc837379e 100644
--- a/addons/base/controllers/main.py
+++ b/addons/base/controllers/main.py
@@ -177,7 +177,26 @@ class DataSet(openerpweb.Controller):
def do_find(self, request, model, fields=False, offset=0, limit=False,
domain=None, context=None, sort=None):
""" Performs a search() followed by a read() (if needed) using the
- provided search criteria, only
+ provided search criteria
+
+ :param request: a JSON-RPC request object
+ :type request: openerpweb.JsonRequest
+ :param model: the name of the model to search on
+ :type model: str
+ :param fields: a list of the fields to return in the result records
+ :type fields: [str]
+ :param offset: from which index should the results start being returned
+ :type offset: int
+ :param limit: the maximum number of records to return
+ :type limit: int
+ :param domain: the search domain for the query
+ :type domain: list
+ :param context: the context in which the search should be executed
+ :type context: dict
+ :param sort: sorting directives
+ :type sort: list
+ :returns: a list of result records
+ :rtype: []
"""
Model = request.session.model(model)
ids = Model.search(domain or [], offset or 0, limit or False,
@@ -204,6 +223,8 @@ class DataSet(openerpweb.Controller):
:type model: str
:param ids: a list of identifiers
:type ids: list
+ :returns: a list of records, in the same order as the list of ids
+ :rtype: list
"""
Model = request.session.model(model)
records = Model.read(ids)
diff --git a/doc/source/conf.py b/doc/source/conf.py
index d3f486f19c5..13a490c5072 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -16,7 +16,8 @@ import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../../addons'))
+sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration -----------------------------------------------------
diff --git a/doc/source/development.rst b/doc/source/development.rst
index a2be0ec2eef..afc6040227d 100644
--- a/doc/source/development.rst
+++ b/doc/source/development.rst
@@ -8,6 +8,15 @@ Contributing to OpenERP Web
* Style guide and coding conventions (PEP8? More)
* Test frameworks in JS?
+Internal API Doc
+----------------
+
+Python
+++++++
+
+.. autoclass:: base.controllers.main.DataSet
+ :members:
+
Testing
-------