doc/book/devrepo/devcore/reqbase.rst
author Denis Laxalde <denis.laxalde@logilab.fr>
Tue, 22 Dec 2015 09:23:00 +0100
changeset 11144 fd8bf29ed00e
parent 10491 c67bcee93248
permissions -rw-r--r--
[tox] Generate test environments for Python 2.7 and 3.4 Test commands for each environment are written down explicitly since I could not find a way to extract the "package" name (e.g. "hooks") from the environment name (e.g. "py34-hooks"). For Python 3.4 interpreter, only environments (subpackages) that do not depend on cubes for their tests are listed since those test dependency cubes are not yet installable with Python 3.x. etwist is also not included since the Python 3 port is not complete at the moment. From local testing, py34 tests pass for the following subpackages: - dataimport - entities - ext - hooks - wsgi
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5257
a31fbcfa8c3b [doc/book] misc fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5149
diff changeset
     1
Request and ResultSet methods
a31fbcfa8c3b [doc/book] misc fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5149
diff changeset
     2
-----------------------------
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
     3
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     4
Those are methods you'll find on both request objects and on
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     5
repository session.
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     6
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     7
Request methods
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     8
~~~~~~~~~~~~~~~
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
     9
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    10
`URL handling`:
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    11
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    12
* `build_url(*args, **kwargs)`, returns an absolute URL based on the
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    13
  given arguments. The *controller* supposed to handle the response,
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    14
  can be specified through the first positional parameter (the
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    15
  connection is theoretically done automatically :).
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    16
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    17
`Data formatting`:
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    18
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    19
* `format_date(date, date_format=None, time=False)` returns a string for a
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    20
  date time according to instance's configuration
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    21
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    22
* `format_time(time)` returns a string for a date time according to
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    23
  instance's configuration
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    24
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    25
`And more...`:
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    26
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    27
* `tal_render(template, variables)`, renders a precompiled page template with
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    28
  variables in the given dictionary as context
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    29
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    30
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    31
Result set methods
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    32
~~~~~~~~~~~~~~~~~~
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    33
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    34
* `get_entity(row, col)`, returns the entity corresponding to the data position
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    35
  in the *result set*
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    36
5400
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    37
* `complete_entity(row, col, skip_bytes=True)`, is equivalent to `get_entity` but
b7ab099b128a [doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5394
diff changeset
    38
  also call the method `complete()` on the entity before returning it
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    39
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    40