backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 06 Apr 2011 10:10:21 +0200
changeset 7184 59d953d8694e
parent 7180 c031ea58d5f1 (current diff)
parent 7183 5ea2bfd55399 (diff)
child 7187 496f51b92154
backport stable
--- a/hooks/syncschema.py	Tue Apr 05 13:24:02 2011 +0200
+++ b/hooks/syncschema.py	Wed Apr 06 10:10:21 2011 +0200
@@ -912,6 +912,10 @@
     def __call__(self):
         entity = self.entity
         if entity.cw_edited.get('final'):
+            # final entity types don't need a table in the database and are
+            # systematically added by yams at initialization time so there is no
+            # need to do further processing. Simply assign its eid.
+            self._cw.vreg.schema[entity.name].eid = entity.eid
             return
         CWETypeAddOp(self._cw, entity=entity)
 
--- a/web/views/calendar.py	Tue Apr 05 13:24:02 2011 +0200
+++ b/web/views/calendar.py	Wed Apr 06 10:10:21 2011 +0200
@@ -229,15 +229,15 @@
         events = []
         for entity in self.cw_rset.entities():
             icalendarable = entity.cw_adapt_to('ICalendarable')
+            if not (icalendarable.start and icalendarable.stop):
+                continue
+            start_date = icalendarable.start or  icalendarable.stop
             event = {'eid': entity.eid,
                      'title': entity.view('calendaritem'),
                      'url': xml_escape(entity.absolute_url()),
                      'className': 'calevent',
                      'description': entity.view('tooltip'),
                      }
-            start_date = icalendarable.start
-            if not start_date:
-                start_date = icalendarable.stop
             event['start'] = start_date.strftime('%Y-%m-%dT%H:%M')
             event['allDay'] = True
             if icalendarable.stop:
--- a/web/views/editcontroller.py	Tue Apr 05 13:24:02 2011 +0200
+++ b/web/views/editcontroller.py	Wed Apr 06 10:10:21 2011 +0200
@@ -182,7 +182,12 @@
         # process inlined relations at the same time as attributes
         # this will generate less rql queries and might be useful in
         # a few dark corners
-        formid = self._cw.form.get('__form_id', 'edition')
+        if is_main_entity:
+            formid = self._cw.form.get('__form_id', 'edition')
+        else:
+            # XXX inlined forms formid should be saved in a different formparams entry
+            # inbetween, use cubicweb standard formid for inlined forms
+            formid = 'edition'
         form = self._cw.vreg['forms'].select(formid, self._cw, entity=entity)
         eid = form.actual_eid(entity.eid)
         form.formvalues = {} # init fields value cache