doc/book/devrepo/devcore/reqbase.rst
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 28 Jan 2016 18:17:30 +0100
changeset 11090 b4b854c25de5
parent 10491 c67bcee93248
permissions -rw-r--r--
[repository] set .eid on eschema when schema is loaded from the filesystem enforcing the contract that a repository's schema should have .eid attribute of entity schema set to the eid of the entity used to serialize them in the db. Before this cset, this was not true during tests or for some c-c commands where 'quick_start' is set (eg db-restore, i18ncube...). The change in server __init__ makes this assumption true during instance creation: the serializing code was actually setting eid on schema object, but a reference to a previously built schema was given instead of the one for the latest created repository. Closes #10450092
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