# HG changeset patch # User Sylvain Thénault # Date 1249315174 -7200 # Node ID c8aa82538d8e7dfbb6ae625200b26839f9ce6e5e # Parent c6c832d32936a18e9ade39d3122a15d38cbab094 [repo] explicitly specifies edited attributes to glob_update_entity diff -r c6c832d32936 -r c8aa82538d8e server/repository.py --- a/server/repository.py Mon Aug 03 17:32:42 2009 +0200 +++ b/server/repository.py Mon Aug 03 17:59:34 2009 +0200 @@ -1038,13 +1038,15 @@ entity.eid, attr, value) return entity.eid - def glob_update_entity(self, session, entity): + def glob_update_entity(self, session, entity, edited_attributes): """replace an entity in the repository the type and the eid of an entity must not be changed """ etype = str(entity.e_schema) if server.DEBUG & server.DBG_REPO: - print 'UPDATE entity', etype, entity.eid, dict(entity) + print 'UPDATE entity', etype, entity.eid, \ + dict(entity), edited_attributes + entity.edited_attributes = edited_attributes entity.check() eschema = entity.e_schema session.set_entity_cache(entity) diff -r c6c832d32936 -r c8aa82538d8e server/ssplanner.py --- a/server/ssplanner.py Mon Aug 03 17:32:42 2009 +0200 +++ b/server/ssplanner.py Mon Aug 03 17:59:34 2009 +0200 @@ -482,6 +482,7 @@ repo = session.repo edefs = {} # insert relations + attributes = [relation.r_type for relation in self.attribute_relations] for row in self.execute_child(): for relation in self.attribute_relations: lhs, rhs = relation.get_variable_parts() @@ -489,7 +490,7 @@ try: edef = edefs[eid] except KeyError: - edefs[eid] = edef = session.eid_rset(eid).get_entity(0, 0) + edefs[eid] = edef = session.entity_from_eid(eid) if isinstance(rhs, Constant): # add constant values to entity def value = rhs.eval(plan.args) @@ -503,6 +504,6 @@ # update entities result = [] for eid, edef in edefs.iteritems(): - repo.glob_update_entity(session, edef) + repo.glob_update_entity(session, edef, attributes) result.append( (eid,) ) return result