def one_one_in_other(book_id_val_map, db, field, *args):
 deleted = tuple(((k,) for (k, v) in book_id_val_map.iteritems() if (v is None)))
 if deleted:
  db.executemany((u'DELETE FROM %s WHERE book=?' % field.metadata[u'table']), deleted)
  for book_id in deleted:
   field.table.book_col_map.pop(book_id[0], None)
 updated = {k: v for (k, v) in book_id_val_map.iteritems() if (v is not None)}
 if updated:
  db.executemany((u'INSERT OR REPLACE INTO %s(book,%s) VALUES (?,?)' % (field.metadata[u'table'], field.metadata[u'column'])), ((k, sqlite_datetime(v)) for (k, v) in updated.iteritems()))
  field.table.book_col_map.update(updated)
 return set(book_id_val_map)

def one_one_in_other ( book_id_val_map , db , field , * args ) : deleted = tuple ( ( ( k , ) for ( k , v ) in book_id_val_map . iteritems ( ) if ( v is None ) ) ) if deleted : db . executemany ( ( u'DELETE FROM %s WHERE book=?' % field . metadata [ u'table' ] ) , deleted ) for book_id in deleted : field . table . book_col_map . pop ( book_id [ 0 ] , None ) updated = { k : v for ( k , v ) in book_id_val_map . iteritems ( ) if ( v is not None ) } if updated : db . executemany ( ( u'INSERT OR REPLACE INTO %s(book,%s) VALUES (?,?)' % ( field . metadata [ u'table' ] , field . metadata [ u'column' ] ) ) , ( ( k , sqlite_datetime ( v ) ) for ( k , v ) in updated . iteritems ( ) ) ) field . table . book_col_map . update ( updated ) return set ( book_id_val_map )
set a one-one field in the non-books table .