def db_add_group(**kwargs):
 name = kwargs.get('name')
 group = get_object(AssetGroup, name=name)
 asset_id_list = kwargs.pop('asset_select')
 if (not group):
  group = AssetGroup(**kwargs)
  group.save()
  for asset_id in asset_id_list:
   group_add_asset(group, asset_id)

def db_add_group ( ** kwargs ) : name = kwargs . get ( 'name' ) group = get_object ( AssetGroup , name = name ) asset_id_list = kwargs . pop ( 'asset_select' ) if ( not group ) : group = AssetGroup ( ** kwargs ) group . save ( ) for asset_id in asset_id_list : group_add_asset ( group , asset_id )
add a asset group in database .