server/sqlutils.py
changeset 6142 8bc6eac1fac1
parent 5768 1e73a466aa69
child 6333 e3994fcc21c3
equal deleted inserted replaced
6141:b8287e54b528 6142:8bc6eac1fac1
   258         """return a dictionary to use as extra argument to cursor.execute
   258         """return a dictionary to use as extra argument to cursor.execute
   259         to insert/update an entity into a SQL database
   259         to insert/update an entity into a SQL database
   260         """
   260         """
   261         attrs = {}
   261         attrs = {}
   262         eschema = entity.e_schema
   262         eschema = entity.e_schema
   263         for attr in entity.edited_attributes:
   263         for attr, value in entity.cw_edited.iteritems():
   264             value = entity[attr]
       
   265             rschema = eschema.subjrels[attr]
   264             rschema = eschema.subjrels[attr]
   266             if rschema.final:
   265             if rschema.final:
   267                 atype = str(entity.e_schema.destination(attr))
   266                 atype = str(eschema.destination(attr))
   268                 if atype == 'Boolean':
   267                 if atype == 'Boolean':
   269                     value = self.dbhelper.boolean_value(value)
   268                     value = self.dbhelper.boolean_value(value)
   270                 elif atype == 'Password':
   269                 elif atype == 'Password':
   271                     # if value is a Binary instance, this mean we got it
   270                     # if value is a Binary instance, this mean we got it
   272                     # from a query result and so it is already encrypted
   271                     # from a query result and so it is already encrypted