misc/migration/3.16.0_Any.py
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 13 Jun 2013 15:12:06 +0200
changeset 9020 cb87e831c183
parent 8675 b60329e40e26
permissions -rw-r--r--
rename server.session.transaction into server.session.connection The ongoing rework of the API to access the database include the splitting of Session in two objects: The ``Session`` object will only hold credential (user) and global session data. A new object will publicly emerge to handle a database access. This object is named ``Connection`` since that the way database accessors with the same property are named in other system. So we renamed the ``Transaction`` object into ``Connection``. The ``Transaction`` object have already grown in the direction of something directly usable by generic code, but the name ``Transaction`` is ill suited as such object can be used for multiple database transaction in a row. Related to #2503918
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8675
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     1
sync_schema_props_perms('EmailAddress')
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     2
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     3
for source in rql('CWSource X WHERE X type "pyrorql"').entities():
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     4
    sconfig = source.dictconfig
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     5
    nsid = sconfig.pop('pyro-ns-id', config.appid)
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     6
    nshost = sconfig.pop('pyro-ns-host', '')
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     7
    nsgroup = sconfig.pop('pyro-ns-group', ':cubicweb')
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     8
    if nsgroup:
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     9
        nsgroup += '.'
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    10
    source.cw_set(url=u'pyro://%s/%s%s' % (nshost, nsgroup, nsid))
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    11
    source.update_config(skip_unknown=True, **sconfig)
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    12
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    13
commit()