fixed metadata calls
[myslice.git] / manifold / metadata.py
index 41a16f3..f250228 100644 (file)
@@ -26,24 +26,25 @@ class MetaData:
             except:
                 print "metadata.work_offline: failed to decode %s"%offline_filename
         manifold_api = ManifoldAPI(self.auth)
-        fields = ['table', 'column.column',
-                  'column.description','column.header', 'column.title',
-                  'column.unit', 'column.info_type',
-                  'column.resource_type', 'column.value_type',
-                  'column.allowed_values', 'column.platforms.platform',
-                  'column.platforms.platform_url']
-        rows_result = manifold_api.Get({
+        fields = ['table', 'column.name', 'column.qualifier', 'column.type', 'column.is_array', 'column.description']
+        #fields = ['table', 'column.column',
+        #          'column.description','column.header', 'column.title',
+        #          'column.unit', 'column.info_type',
+        #          'column.resource_type', 'column.value_type',
+        #          'column.allowed_values', 'column.platforms.platform',
+        #          'column.platforms.platform_url']
+        result = manifold_api.Get({
             'object': 'local:object', # proposed to replace metadata:table
             'fields':     fields 
         })
 
-        if row_results['code'] == 1: # warning
+        if result['code'] == 1: # warning
             messages.warning(request, result['description'])
-        elif row_results['code'] == 2:
+        elif result['code'] == 2:
             messages.error(request, result['description'])
             # XXX FAIL HERE XXX
 
-        rows = rows_result.ok_value()
+        rows = result.ok_value()
 # API errors will be handled by the outer logic
 #        if not rows:
 #            print "Failed to retrieve metadata",rows_result.error()