merge
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 04 Jan 2016 17:23:36 +0100
changeset 11050 b356acb36e15
parent 11047 bfd11ffa79f7 (diff)
parent 11049 1f41697f2e26 (current diff)
child 11051 de472896fc0a
merge
--- a/debian/cubicweb-documentation.doc-base	Wed Dec 09 08:44:45 2015 +0100
+++ b/debian/cubicweb-documentation.doc-base	Mon Jan 04 17:23:36 2016 +0100
@@ -5,5 +5,5 @@
 Section: Apps/Programming
 
 Format: HTML
-Index: /usr/share/doc/cubicweb-documentation/index.html
-Files: /usr/share/doc/cubicweb-documentation/*.html
+Index: /usr/share/doc/cubicweb-documentation/html/index.html
+Files: /usr/share/doc/cubicweb-documentation/html/*
--- a/doc/changes/3.22.rst	Wed Dec 09 08:44:45 2015 +0100
+++ b/doc/changes/3.22.rst	Mon Jan 04 17:23:36 2016 +0100
@@ -16,6 +16,17 @@
 * cubes custom sql scripts are executed before creating tables.  This allows
   them to create new types or extensions.
 
+* the ``ejsonexport`` view can be specialized using the new ``ISerializable``
+  entity adapter.  By default, it will return an entity's (non-Bytes and
+  non-Password) attributes plus the special ``cw_etype`` and ``cw_source``
+  keys.
+
+* cubes that define custom final types are now handled by the ``add_cube``
+  migration command.
+
+* synchronization of external sources can be triggered from the web interface
+  by suitably privileged users with a new ``cw.source-sync`` action.
+
 User-visible changes
 --------------------
 
@@ -34,7 +45,8 @@
 -----------
 
 * ``config.repository()`` creates a new Repository object each time, instead of
-  returning a cached object
+  returning a cached object.  WARNING: this may cause unexpected issues if
+  several repositories end up being used.
 
 * migration scripts, as well as other scripts executed by ``cubicweb-ctl
   shell``, are loaded with the print_function flag enabled (for backwards
@@ -61,6 +73,14 @@
 
 * the session manager lives in the ``sessions`` registry instead of ``components``.
 
+* ``TZDatetime`` attributes are returned as timezone-aware python datetime
+  objects.  WARNING: this will break client applications that compare or use
+  arithmetic involving timezone-naive datetime objects.
+
+* creation_date and modification_date attributes for all entities are now
+  timezone-aware (``TZDatetime``) instead of localtime (``Datetime``).  More
+  generally, the ``Datetime`` type should be considered as deprecated.
+
 Deprecated code drops
 ---------------------
 
--- a/entities/adapters.py	Wed Dec 09 08:44:45 2015 +0100
+++ b/entities/adapters.py	Mon Jan 04 17:23:36 2016 +0100
@@ -363,6 +363,7 @@
         data = {
             'cw_etype': entity.cw_etype,
             'cw_source': entity.cw_metainformation()['source']['uri'],
+            'eid': entity.eid,
         }
         for rschema, __ in entity.e_schema.attribute_definitions():
             attr = rschema.type
--- a/entities/test/unittest_base.py	Wed Dec 09 08:44:45 2015 +0100
+++ b/entities/test/unittest_base.py	Mon Jan 04 17:23:36 2016 +0100
@@ -249,6 +249,7 @@
             expected = {
                 'cw_etype': u'CWGroup',
                 'cw_source': 'system',
+                'eid': entity.eid,
                 'cwuri': u'http://testing.fr/cubicweb/%s' % entity.eid,
                 'creation_date': entity.creation_date,
                 'modification_date': entity.modification_date,
--- a/entity.py	Wed Dec 09 08:44:45 2015 +0100
+++ b/entity.py	Mon Jan 04 17:23:36 2016 +0100
@@ -378,7 +378,7 @@
                 else:
                     fetchattrs = etypecls.fetch_attrs
                 etypecls._fetch_restrictions(var, select, fetchattrs,
-                                             user, ordermethod, visited=visited)
+                                             user, None, visited=visited)
             if ordermethod is not None:
                 try:
                     cmeth = getattr(cls, ordermethod)
--- a/sobjects/ldapparser.py	Wed Dec 09 08:44:45 2015 +0100
+++ b/sobjects/ldapparser.py	Mon Jan 04 17:23:36 2016 +0100
@@ -120,8 +120,8 @@
     def build_importer(self, raise_on_error):
         """Instantiate and configure an importer"""
         etypes = ('CWUser', 'EmailAddress', 'CWGroup')
-        extid2eid = dict((x.encode('ascii'), y) for x, y in
-                importer.cwuri2eid(self._cw, etypes, source_eid=self.source.eid).items())
+        extid2eid = dict((self.source.decode_extid(x), y) for x, y in
+                self._cw.system_sql('select extid, eid from entities where asource = %(s)s', {'s': self.source.uri}))
         existing_relations = {}
         for rtype in ('in_group', 'use_email', 'owned_by'):
             rql = 'Any S,O WHERE S {} O, S cw_source SO, SO eid %(s)s'.format(rtype)
--- a/test/unittest_entity.py	Wed Dec 09 08:44:45 2015 +0100
+++ b/test/unittest_entity.py	Mon Jan 04 17:23:36 2016 +0100
@@ -245,7 +245,7 @@
                 Personne.fetch_attrs = ('nom', 'prenom', 'travaille')
                 Societe.fetch_attrs = ('nom', 'evaluee')
                 self.assertEqual(Personne.fetch_rql(user),
-                                 'Any X,AA,AB,AC,AD,AE,AF ORDERBY AA,AE DESC '
+                                 'Any X,AA,AB,AC,AD,AE,AF ORDERBY AA '
                                  'WHERE X is_instance_of Personne, X nom AA, X prenom AB, X travaille AC?, '
                                  'AC evaluee AD?, AD modification_date AE, AC nom AF')
                 # testing symmetric relation