def resource_data_get_all(context, resource_id, data=None):
 if (data is None):
  data = context.session.query(models.ResourceData).filter_by(resource_id=resource_id).all()
 if (not data):
  raise exception.NotFound(_('no resource data found'))
 ret = {}
 for res in data:
  if res.redact:
   ret[res.key] = crypt.decrypt(res.decrypt_method, res.value)
  else:
   ret[res.key] = res.value
 return ret

def resource_data_get_all ( context , resource_id , data = None ) : if ( data is None ) : data = context . session . query ( models . ResourceData ) . filter_by ( resource_id = resource_id ) . all ( ) if ( not data ) : raise exception . NotFound ( _ ( 'no resource data found' ) ) ret = { } for res in data : if res . redact : ret [ res . key ] = crypt . decrypt ( res . decrypt_method , res . value ) else : ret [ res . key ] = res . value return ret
looks up resource_data by resource .