-from __future__ import print_function
-
import json
import os.path
from django.contrib import messages
+from myslice.settings import logger
+
debug=False
#debug=True
class MetaData:
- def __init__ (self, auth):
+ def __init__ (self, url, auth):
+ self.url = url
self.auth=auth
self.hash_by_object={}
def fetch (self, request):
- manifold_api = ManifoldAPI(self.auth)
+ manifold_api = ManifoldAPI(self.url, self.auth)
fields = ['table', 'column.name', 'column.qualifier', 'column.type',
'column.is_array', 'column.description', 'column.default', 'key', 'capability']
#fields = ['table', 'column.column',
# xxx need a way to export error messages to the UI
if result['code'] == 1: # warning
# messages.warning(request, result['description'])
- print(("METADATA WARNING -",request,result['description']))
+ logger.warning(("METADATA WARNING - {} {}".format(request,result['description'])))
elif result['code'] == 2:
# messages.error(request, result['description'])
- print(("METADATA ERROR -",request,result['description']))
+ logger.error(("METADATA ERROR - {} {}".format(request,result['description'])))
# XXX FAIL HERE XXX
return
return self.hash_by_object[object]['column'].sort()
def get_field_type(self, object, field):
- if debug: print("Temp fix for metadata::get_field_type() -> consider moving to manifold.core.metadata soon")
+ if debug:
+ logger.debug("Temp fix for metadata::get_field_type() -> consider moving to manifold.core.metadata soon")
return field