def obj_make_dict_of_lists(context, list_cls, obj_list, item_key):
 obj_lists = {}
 for obj in obj_list:
  key = getattr(obj, item_key)
  if (key not in obj_lists):
   obj_lists[key] = list_cls()
   obj_lists[key].objects = []
  obj_lists[key].objects.append(obj)
 for key in obj_lists:
  obj_lists[key]._context = context
  obj_lists[key].obj_reset_changes()
 return obj_lists

def obj_make_dict_of_lists ( context , list_cls , obj_list , item_key ) : obj_lists = { } for obj in obj_list : key = getattr ( obj , item_key ) if ( key not in obj_lists ) : obj_lists [ key ] = list_cls ( ) obj_lists [ key ] . objects = [ ] obj_lists [ key ] . objects . append ( obj ) for key in obj_lists : obj_lists [ key ] . _context = context obj_lists [ key ] . obj_reset_changes ( ) return obj_lists
construct a dictionary of object lists .