X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifold%2Fmetadata.py;h=eb0e48a4c80dcd800c3e653623eb74a762e4b0c1;hb=f14a5114d0cf6673c172bdb89669fa80efcd3f2b;hp=c092dfdc8f86167a665db317c993a44be73e329b;hpb=57c5bcefb1eac66d1db27db28a0c6d3b3b52a407;p=myslice.git diff --git a/manifold/metadata.py b/manifold/metadata.py index c092dfdc..eb0e48a4 100644 --- a/manifold/metadata.py +++ b/manifold/metadata.py @@ -16,6 +16,9 @@ class MetaData: self.auth=auth self.hash_by_subject={} + # XXX Retrieve all metadata the first time we instanciate the class + self.fetch() + def fetch (self): offline_filename="offline-metadata.json" if work_offline: @@ -32,10 +35,15 @@ class MetaData: 'column.resource_type', 'column.value_type', 'column.allowed_values', 'column.platforms.platform', 'column.platforms.platform_url'] - rows_result = manifold_api.Get('metadata:table', [], [], fields) + rows_result = manifold_api.Get({ + 'fact_table': 'local:objects', # proposed to replace metadata:table + 'fields': fields + }) +#old# rows_result = manifold_api.Get('metadata:table', [], [], fields) rows = rows_result.ok_value() if not rows: print "Failed to retrieve metadata",rows_result.error() + rows=[] self.hash_by_subject = dict ( [ (row['table'], row) for row in rows ] ) # save for next time we use offline mode if debug: @@ -50,4 +58,3 @@ class MetaData: def sorted_fields_by_subject (self, subject): return self.hash_by_subject[subject]['columns'].sort() -