def _collect_post_update_commands(base_mapper, uowtransaction, table, states_to_update, post_update_cols):
 update = []
 for (state, state_dict, mapper, connection) in states_to_update:
  if (table not in mapper._pks_by_table):
   continue
  pks = mapper._pks_by_table[table]
  params = {}
  hasdata = False
  for col in mapper._cols_by_table[table]:
   if (col in pks):
    params[col._label] = mapper._get_state_attr_by_column(state, state_dict, col)
   elif (col in post_update_cols):
    prop = mapper._columntoproperty[col]
    history = attributes.get_state_history(state, prop.key, attributes.PASSIVE_NO_INITIALIZE)
    if history.added:
     value = history.added[0]
     params[col.key] = value
     hasdata = True
  if hasdata:
   update.append((state, state_dict, params, mapper, connection))
 return update

def _collect_post_update_commands ( base_mapper , uowtransaction , table , states_to_update , post_update_cols ) : update = [ ] for ( state , state_dict , mapper , connection ) in states_to_update : if ( table not in mapper . _pks_by_table ) : continue pks = mapper . _pks_by_table [ table ] params = { } hasdata = False for col in mapper . _cols_by_table [ table ] : if ( col in pks ) : params [ col . _label ] = mapper . _get_state_attr_by_column ( state , state_dict , col ) elif ( col in post_update_cols ) : prop = mapper . _columntoproperty [ col ] history = attributes . get_state_history ( state , prop . key , attributes . PASSIVE_NO_INITIALIZE ) if history . added : value = history . added [ 0 ] params [ col . key ] = value hasdata = True if hasdata : update . append ( ( state , state_dict , params , mapper , connection ) ) return update
identify sets of values to use in update statements for a list of states within a post_update operation .