doc/book/en/development/devcore/reqbase.rst
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 14 Apr 2010 16:56:33 +0200
branchstable
changeset 5257 a31fbcfa8c3b
parent 5149 a6bcb3c264fe
permissions -rw-r--r--
[doc/book] misc fixes
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
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
     4
Those are methods you'll find on both request objects and on repository session:
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
     5
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
     6
:URL handling:
3258
6536ee4f37f7 update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 2476
diff changeset
     7
  * `build_url(*args, **kwargs)`, returns an absolute URL based on the
6536ee4f37f7 update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 2476
diff changeset
     8
    given arguments. The *controller* supposed to handle the response,
6536ee4f37f7 update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 2476
diff changeset
     9
    can be specified through the first positional parameter (the
6536ee4f37f7 update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 2476
diff changeset
    10
    connection is theoretically done automatically :).
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    11
:Data formatting:
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    12
  * `format_date(date, date_format=None, time=False)` returns a string for a
3258
6536ee4f37f7 update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 2476
diff changeset
    13
    date time according to instance's configuration
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    14
3258
6536ee4f37f7 update the documentation
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 2476
diff changeset
    15
  * `format_time(time)` returns a string for a date time according to
2476
1294a6bdf3bf application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2172
diff changeset
    16
    instance's configuration
1714
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    17
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    18
:And more...:
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    19
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    20
  * `tal_render(template, variables)`, renders a precompiled page template with
a721966779be new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff changeset
    21
    variables in the given dictionary as context
5149
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    22
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    23
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    24
Result set methods:
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    25
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    26
  * `get_entity(row, col)`, returns the entity corresponding to the data position
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    27
    in the *result set*
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    28
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    29
  * `complete_entity(row, col, skip_bytes=True)`, is equivalent to `get_entity` but
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    30
    also call the method `complete()` on the entity before returning it
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    31
a6bcb3c264fe temporary move
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5147
diff changeset
    32