author | Julien Cristau <julien.cristau@logilab.fr> |
Thu, 03 Jul 2014 12:18:34 +0200 | |
changeset 9867 | 7f36f31d8828 |
parent 9776 | d5413f2453a1 |
permissions | -rw-r--r-- |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
1 |
What's new in CubicWeb 3.19? |
9015
65b8236e1bb4
[sources] drop support for ldapuser source (closes #2936496)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
2 |
============================ |
65b8236e1bb4
[sources] drop support for ldapuser source (closes #2936496)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
3 |
|
9571
aaf83cc07eed
[web] implement cross origin resource sharing (CORS) (closes #2491768)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
9568
diff
changeset
|
4 |
New functionalities |
aaf83cc07eed
[web] implement cross origin resource sharing (CORS) (closes #2491768)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
9568
diff
changeset
|
5 |
-------------------- |
aaf83cc07eed
[web] implement cross origin resource sharing (CORS) (closes #2491768)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
9568
diff
changeset
|
6 |
|
aaf83cc07eed
[web] implement cross origin resource sharing (CORS) (closes #2491768)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
9568
diff
changeset
|
7 |
* implement Cross Origin Resource Sharing (CORS) |
aaf83cc07eed
[web] implement cross origin resource sharing (CORS) (closes #2491768)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
9568
diff
changeset
|
8 |
(see `#2491768 <http://www.cubicweb.org/2491768>`_) |
aaf83cc07eed
[web] implement cross origin resource sharing (CORS) (closes #2491768)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
9568
diff
changeset
|
9 |
|
9710
dff4bda87c6a
[doc] update 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9687
diff
changeset
|
10 |
* system_source.create_eid can get a range of IDs, to reduce overhead of batch |
dff4bda87c6a
[doc] update 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9687
diff
changeset
|
11 |
entity creation |
9571
aaf83cc07eed
[web] implement cross origin resource sharing (CORS) (closes #2491768)
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
9568
diff
changeset
|
12 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
13 |
Behaviour Changes |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
14 |
----------------- |
9042
6cc13a0a9145
[dbapi] makes anonymous_connection a computed property
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9038
diff
changeset
|
15 |
|
6cc13a0a9145
[dbapi] makes anonymous_connection a computed property
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9038
diff
changeset
|
16 |
* The anonymous property of Session and Connection are now computed from the |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
17 |
related user login. If it matches the ``anonymous-user`` in the config the |
9042
6cc13a0a9145
[dbapi] makes anonymous_connection a computed property
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9038
diff
changeset
|
18 |
connection is anonymous. Beware that the ``anonymous-user`` config is web |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
19 |
specific. Therefore, no session may be anonymous in a repository only setup. |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
20 |
|
9042
6cc13a0a9145
[dbapi] makes anonymous_connection a computed property
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9038
diff
changeset
|
21 |
|
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
22 |
New Repository Access API |
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
23 |
------------------------- |
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
24 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
25 |
Connection replaces Session |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
26 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
27 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
28 |
A new explicit Connection object replaces Session as the main repository entry |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
29 |
point. Connection holds all the necessary methods to be used server-side |
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
30 |
(``execute``, ``commit``, ``rollback``, ``call_service``, ``entity_from_eid``, |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
31 |
etc...). One obtains a new Connection object using ``session.new_cnx()``. |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
32 |
Connection objects need to have an explicit begin and end. Use them as a context |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
33 |
manager to never miss an end:: |
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
34 |
|
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
35 |
with session.new_cnx() as cnx: |
9710
dff4bda87c6a
[doc] update 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9687
diff
changeset
|
36 |
cnx.execute('INSERT Elephant E, E name "Babar"') |
dff4bda87c6a
[doc] update 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9687
diff
changeset
|
37 |
cnx.commit() |
dff4bda87c6a
[doc] update 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9687
diff
changeset
|
38 |
cnx.execute('INSERT Elephant E, E name "Celeste"') |
dff4bda87c6a
[doc] update 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9687
diff
changeset
|
39 |
cnx.commit() |
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
40 |
# Once you get out of the "with" clause, the connection is closed. |
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
41 |
|
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
42 |
Using the same Connection object in multiple threads will give you access to the |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
43 |
same Transaction. However, Connection objects are not thread safe (hence at your |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
44 |
own risks). |
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
45 |
|
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
46 |
``repository.internal_session`` is deprecated in favor of |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
47 |
``repository.internal_cnx``. Note that internal connections are now `safe` by default, |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
48 |
i.e. the integrity hooks are enabled. |
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
49 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
50 |
Backward compatibility is preserved on Session. |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
51 |
|
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
52 |
|
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
53 |
dbapi vs repoapi |
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
54 |
~~~~~~~~~~~~~~~~ |
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
55 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
56 |
A new API has been introduced to replace the dbapi. It is called `repoapi`. |
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
57 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
58 |
There are three relevant functions for now: |
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
59 |
|
9513
a7e0746f010c
[doc/3.19] Clarify repoapi.get_repository usage
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
9486
diff
changeset
|
60 |
* ``repoapi.get_repository`` returns a Repository object either from an |
a7e0746f010c
[doc/3.19] Clarify repoapi.get_repository usage
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
9486
diff
changeset
|
61 |
URI when used as ``repoapi.get_repository(uri)`` or from a config |
a7e0746f010c
[doc/3.19] Clarify repoapi.get_repository usage
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
9486
diff
changeset
|
62 |
when used as ``repoapi.get_repository(config=config)``. |
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
63 |
|
9486
9a62c52d167e
[doc/3.19] Make repoapi description match code
Julien Cristau <julien.cristau@logilab.fr>
parents:
9405
diff
changeset
|
64 |
* ``repoapi.connect(repo, login, **credentials)`` returns a ClientConnection |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
65 |
associated with the user identified by the credentials. The |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
66 |
ClientConnection is associated with its own Session that is closed |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
67 |
when the ClientConnection is closed. A ClientConnection is a |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
68 |
Connection-like object to be used client side. |
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
69 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
70 |
* ``repoapi.anonymous_cnx(repo)`` returns a ClientConnection associated |
9486
9a62c52d167e
[doc/3.19] Make repoapi description match code
Julien Cristau <julien.cristau@logilab.fr>
parents:
9405
diff
changeset
|
71 |
with the anonymous user if described in the config. |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
72 |
|
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
73 |
|
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
74 |
repoapi.ClientConnection replace dbapi.Connection and company |
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
75 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
76 |
|
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
77 |
On the client/web side, the Request is now using a ``repoapi.ClientConnection`` |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
78 |
instead of a ``dbapi.connection``. The ``ClientConnection`` has multiple backward |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
79 |
compatible methods to make it look like a ``dbapi.Cursor`` and ``dbapi.Connection``. |
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
80 |
|
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
81 |
Session used on the Web side are now the same than the one used Server side. |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
82 |
Some backward compatibility methods have been installed on the server side Session |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
83 |
to ease the transition. |
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
84 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
85 |
The authentication stack has been altered to use the ``repoapi`` instead of |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
86 |
the ``dbapi``. Cubes adding new element to this stack are likely to break. |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
87 |
|
9776
d5413f2453a1
[doc/3.19] Mention [gs]et_shared_data deprecation
Julien Cristau <julien.cristau@logilab.fr>
parents:
9712
diff
changeset
|
88 |
Session data can be accessed using the cnx.data dictionary, while |
d5413f2453a1
[doc/3.19] Mention [gs]et_shared_data deprecation
Julien Cristau <julien.cristau@logilab.fr>
parents:
9712
diff
changeset
|
89 |
transaction data is available through cnx.transaction_data. These |
d5413f2453a1
[doc/3.19] Mention [gs]et_shared_data deprecation
Julien Cristau <julien.cristau@logilab.fr>
parents:
9712
diff
changeset
|
90 |
replace the [gs]et_shared_data methods with optional txid kwarg. |
9115
fcc732a9d9ac
[documentation] describe repoapi and web side change.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9113
diff
changeset
|
91 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
92 |
New API in tests |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
93 |
~~~~~~~~~~~~~~~~ |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
94 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
95 |
All current methods and attributes used to access the repo on ``CubicWebTC`` are |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
96 |
deprecated. You may now use a ``RepoAccess`` object. A ``RepoAccess`` object is |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
97 |
linked to a new ``Session`` for a specified user. It is able to create |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
98 |
``Connection``, ``ClientConnection`` and web side requests linked to this |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
99 |
session:: |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
100 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
101 |
access = self.new_access('babar') # create a new RepoAccess for user babar |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
102 |
with access.repo_cnx() as cnx: |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
103 |
# some work with server side cnx |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
104 |
cnx.execute(...) |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
105 |
cnx.commit() |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
106 |
cnx.execute(...) |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
107 |
cnx.commit() |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
108 |
|
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
109 |
with access.client_cnx() as cnx: |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
110 |
# some work with client side cnx |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
111 |
cnx.execute(...) |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
112 |
cnx.commit() |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
113 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
114 |
with access.web_request(elephant='babar') as req: |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
115 |
# some work with client side cnx |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
116 |
elephant_name = req.form['elephant'] |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
117 |
req.execute(...) |
9119
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
118 |
req.cnx.commit() |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
119 |
|
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
120 |
By default ``testcase.admin_access`` contains a ``RepoAccess`` object for the |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
121 |
default admin session. |
cc85def2ac57
[doc] add documentation for the new API in test
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9115
diff
changeset
|
122 |
|
9113
af6efc15fc90
[repository] add an ``internal_cnx`` method to replace ``internal_session``
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9043
diff
changeset
|
123 |
|
9018
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
124 |
API changes |
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
125 |
----------- |
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
126 |
|
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
127 |
* ``RepositorySessionManager.postlogin`` is now called with two arguments, |
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
128 |
request and session. And this now happens before the session is linked to the |
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
129 |
request. |
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
130 |
|
9032
629a8d49d6f5
[auth] pass `repo` instead of `vreg` to SessionManager and AuthenticationManager
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9018
diff
changeset
|
131 |
* ``SessionManager`` and ``AuthenticationManager`` now take a repo object at |
629a8d49d6f5
[auth] pass `repo` instead of `vreg` to SessionManager and AuthenticationManager
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9018
diff
changeset
|
132 |
initialization time instead of a vreg. |
629a8d49d6f5
[auth] pass `repo` instead of `vreg` to SessionManager and AuthenticationManager
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9018
diff
changeset
|
133 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
134 |
* The ``async`` argument of ``_cw.call_service`` has been dropped. All calls are |
9033
614bf73cc126
[service] drop the asynchronous execution possibility
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9032
diff
changeset
|
135 |
now synchronous. The zmq notification bus looks like a good replacement for |
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
136 |
most async use cases. |
9033
614bf73cc126
[service] drop the asynchronous execution possibility
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9032
diff
changeset
|
137 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
138 |
* ``repo.stats()`` is now deprecated. The same information is available through |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
139 |
a service (``_cw.call_service('repo_stats')``). |
9034
cc3442054e48
[repo] move repo stats to Service (closes #2951067)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9033
diff
changeset
|
140 |
|
9405
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
141 |
* ``repo.gc_stats()`` is now deprecated. The same information is available through |
7fc5e13d049f
[doc/3.19] fix (mostly) grammar
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9404
diff
changeset
|
142 |
a service (``_cw.call_service('repo_gc_stats')``). |
9035
63f3d25bab14
[repo] move repo.gc_stats to Service API (closes #2951068)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9034
diff
changeset
|
143 |
|
9687
00c2356faba7
[server] Refactor Repository.register_user into a CubicWeb service (closes #3020639)
Vladimir Popescu <vladimir.popescu@logilab.fr>
parents:
9673
diff
changeset
|
144 |
* ``repo.register_user()`` is now deprecated. The functionality is now |
00c2356faba7
[server] Refactor Repository.register_user into a CubicWeb service (closes #3020639)
Vladimir Popescu <vladimir.popescu@logilab.fr>
parents:
9673
diff
changeset
|
145 |
available through a service (``_cw.call_service('register_user')``). |
00c2356faba7
[server] Refactor Repository.register_user into a CubicWeb service (closes #3020639)
Vladimir Popescu <vladimir.popescu@logilab.fr>
parents:
9673
diff
changeset
|
146 |
|
9038
1b972d81eda4
[request] drop the user argument for set_session
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9035
diff
changeset
|
147 |
* ``request.set_session`` no longer takes an optional ``user`` argument. |
1b972d81eda4
[request] drop the user argument for set_session
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9035
diff
changeset
|
148 |
|
9043
97c3bb9a7c99
[testlib] move repo and related attribute back on Instance instead of Class
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9042
diff
changeset
|
149 |
* CubicwebTC does not have repo and cnx as class attributes anymore. They are |
97c3bb9a7c99
[testlib] move repo and related attribute back on Instance instead of Class
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9042
diff
changeset
|
150 |
standard instance attributes. ``set_cnx`` and ``_init_repo`` class methods |
97c3bb9a7c99
[testlib] move repo and related attribute back on Instance instead of Class
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9042
diff
changeset
|
151 |
become instance methods. |
97c3bb9a7c99
[testlib] move repo and related attribute back on Instance instead of Class
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9042
diff
changeset
|
152 |
|
9123
c992811edec2
[connection] deprecated free_cnset and set_cnxset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9119
diff
changeset
|
153 |
* ``set_cnxset`` and ``free_cnxset`` are deprecated. cnxset are now |
c992811edec2
[connection] deprecated free_cnset and set_cnxset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9119
diff
changeset
|
154 |
automatically managed. |
c992811edec2
[connection] deprecated free_cnset and set_cnxset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9119
diff
changeset
|
155 |
|
9548
be001628edad
[schema] fix composite deletion handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9513
diff
changeset
|
156 |
* The implementation of cascading deletion when deleting `composite` |
be001628edad
[schema] fix composite deletion handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9513
diff
changeset
|
157 |
entities has changed. There comes a semantic change: merely deleting |
be001628edad
[schema] fix composite deletion handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9513
diff
changeset
|
158 |
a composite relation does not entail any more the deletion of the |
be001628edad
[schema] fix composite deletion handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9513
diff
changeset
|
159 |
component side of the relation. |
be001628edad
[schema] fix composite deletion handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
9513
diff
changeset
|
160 |
|
9568
e8b9a3d23ad9
[web/request] deprecate user_callback
Julien Cristau <julien.cristau@logilab.fr>
parents:
9552
diff
changeset
|
161 |
* ``_cw.user_callback`` and ``_cw.user_rql_callback`` are deprecated. Users |
e8b9a3d23ad9
[web/request] deprecate user_callback
Julien Cristau <julien.cristau@logilab.fr>
parents:
9552
diff
changeset
|
162 |
are encouraged to write an actual controller (e.g. using ``ajaxfunc``) |
e8b9a3d23ad9
[web/request] deprecate user_callback
Julien Cristau <julien.cristau@logilab.fr>
parents:
9552
diff
changeset
|
163 |
instead of storing a closure in the session data. |
e8b9a3d23ad9
[web/request] deprecate user_callback
Julien Cristau <julien.cristau@logilab.fr>
parents:
9552
diff
changeset
|
164 |
|
9712
6c6cd8c4b256
[entity] add a new `cw_linkable_rql` method
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
9710
diff
changeset
|
165 |
* A new ``entity.cw_linkable_rql`` method provides the rql to fetch all entities |
6c6cd8c4b256
[entity] add a new `cw_linkable_rql` method
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
9710
diff
changeset
|
166 |
that are already or may be related to the current entity using the given |
6c6cd8c4b256
[entity] add a new `cw_linkable_rql` method
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
9710
diff
changeset
|
167 |
relation. |
6c6cd8c4b256
[entity] add a new `cw_linkable_rql` method
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
9710
diff
changeset
|
168 |
|
9018
9deb024a96c0
[session-handler] use session directly to update last usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
9016
diff
changeset
|
169 |
|
9015
65b8236e1bb4
[sources] drop support for ldapuser source (closes #2936496)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
170 |
Deprecated Code Drops |
65b8236e1bb4
[sources] drop support for ldapuser source (closes #2936496)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
171 |
---------------------- |
65b8236e1bb4
[sources] drop support for ldapuser source (closes #2936496)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
172 |
|
9016 | 173 |
* session.hijack_user mechanism has been dropped. |
9552
1358f8ef1b5b
[web/basecomponents] remove EtypeRestrictionComponent
Julien Cristau <julien.cristau@logilab.fr>
parents:
9548
diff
changeset
|
174 |
|
1358f8ef1b5b
[web/basecomponents] remove EtypeRestrictionComponent
Julien Cristau <julien.cristau@logilab.fr>
parents:
9548
diff
changeset
|
175 |
* EtypeRestrictionComponent has been removed, its functionality has been |
1358f8ef1b5b
[web/basecomponents] remove EtypeRestrictionComponent
Julien Cristau <julien.cristau@logilab.fr>
parents:
9548
diff
changeset
|
176 |
replaced by facets a while ago. |
1358f8ef1b5b
[web/basecomponents] remove EtypeRestrictionComponent
Julien Cristau <julien.cristau@logilab.fr>
parents:
9548
diff
changeset
|
177 |
|
9673
f5e77035f332
[doc] Add removal of old multi-sources to 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9571
diff
changeset
|
178 |
* the old multi-source support has been removed. Only copy-based sources |
f5e77035f332
[doc] Add removal of old multi-sources to 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9571
diff
changeset
|
179 |
remain, such as datafeed or ldapfeed. |
f5e77035f332
[doc] Add removal of old multi-sources to 3.19 release notes
Julien Cristau <julien.cristau@logilab.fr>
parents:
9571
diff
changeset
|
180 |