def _resource_exists(context, data_dict):
 model = _get_or_bust(context, 'model')
 res_id = _get_or_bust(data_dict, 'resource_id')
 if (not model.Resource.get(res_id)):
  return False
 resources_sql = sqlalchemy.text(u'SELECT 1 FROM "_table_metadata"\n                                        WHERE name = :id AND alias_of IS NULL')
 results = db._get_engine(data_dict).execute(resources_sql, id=res_id)
 return (results.rowcount > 0)

def _resource_exists ( context , data_dict ) : model = _get_or_bust ( context , 'model' ) res_id = _get_or_bust ( data_dict , 'resource_id' ) if ( not model . Resource . get ( res_id ) ) : return False resources_sql = sqlalchemy . text ( u'SELECT 1 FROM "_table_metadata"\n                                        WHERE name = :id AND alias_of IS NULL' ) results = db . _get_engine ( data_dict ) . execute ( resources_sql , id = res_id ) return ( results . rowcount > 0 )
returns true if the resource exists in ckan and in the datastore .