def get_resource_ref_from_model(model):
 try:
  name = model.name
  pack = model.pack
 except AttributeError:
  raise Exception('Cannot build ResourceReference for model: %s. Name or pack missing.', model)
 return ResourceReference(name=name, pack=pack)

def get_resource_ref_from_model ( model ) : try : name = model . name pack = model . pack except AttributeError : raise Exception ( 'Cannot build ResourceReference for model: %s. Name or pack missing.' , model ) return ResourceReference ( name = name , pack = pack )
return a resourcereference given db_model .