equal
deleted
inserted
replaced
158 raise ValidationError(valerror_eid(form.get('__maineid')), errors) |
158 raise ValidationError(valerror_eid(form.get('__maineid')), errors) |
159 |
159 |
160 def _insert_entity(self, etype, eid, rqlquery): |
160 def _insert_entity(self, etype, eid, rqlquery): |
161 rql = rqlquery.insert_query(etype) |
161 rql = rqlquery.insert_query(etype) |
162 try: |
162 try: |
163 # get the new entity (in some cases, the type might have |
|
164 # changed as for the File --> Image mutation) |
|
165 entity = self._cw.execute(rql, rqlquery.kwargs).get_entity(0, 0) |
163 entity = self._cw.execute(rql, rqlquery.kwargs).get_entity(0, 0) |
166 neweid = entity.eid |
164 neweid = entity.eid |
167 except ValidationError, ex: |
165 except ValidationError, ex: |
168 self._to_create[eid] = ex.entity |
166 self._to_create[eid] = ex.entity |
169 if self._cw.json_request: # XXX (syt) why? |
167 if self._cw.json_request: # XXX (syt) why? |