merge stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 29 Jun 2009 16:18:07 +0200
branchstable
changeset 2194 c8c8ef5c5c65
parent 2193 667b6340bfd4 (current diff)
parent 2190 d9f5fd1879fc (diff)
child 2195 58bef4f707ce
merge
--- a/server/session.py	Mon Jun 29 16:16:43 2009 +0200
+++ b/server/session.py	Mon Jun 29 16:18:07 2009 +0200
@@ -317,6 +317,7 @@
                     self.critical('rollback error', exc_info=sys.exc_info())
                     continue
             self.pool.rollback()
+            self.debug('rollback for session %s done', self.id)
         finally:
             self._touch()
             self.pending_operations[:] = []
--- a/web/views/primary.py	Mon Jun 29 16:16:43 2009 +0200
+++ b/web/views/primary.py	Mon Jun 29 16:18:07 2009 +0200
@@ -119,7 +119,19 @@
 
     def render_entity_attributes(self, entity, siderelations=None):
         for rschema, tschemas, role, dispctrl in self._section_def(entity, 'attributes'):
-            vid =  dispctrl.get('vid', 'reledit')
+            # don't use reledit as default vid for composite relation
+            if rschema.is_final():
+                defaultvid = 'reledit'
+            # XXX use entity.e_schema.role_rproperty(role, rschema, 'composite', tschemas[0]) once yams > 0.23.0 is out
+            elif role == 'subject' and \
+                 rschema.rproperty(entity.e_schema, tschemas[0], 'composite'):
+                defaultvid = 'csv'
+            elif role == 'object' and \
+                 rschema.rproperty(tschemas[0], entity.e_schema, 'composite'):
+                defaultvid = 'csv'
+            else:
+                defaultvid = 'reledit'
+            vid =  dispctrl.get('vid', defaultvid)
             if rschema.is_final() or vid == 'reledit':
                 value = entity.view(vid, rtype=rschema.type, role=role)
             else: