diff options
author | Pjotr Prins | 2016-06-26 09:50:29 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-06-26 09:50:29 +0000 |
commit | d1192b1f244e8976fb53c260179eb3715029ebf4 (patch) | |
tree | 9f2e94682b34c8ffa019d4beda90f8c2b1080319 /wqflask/db/call.py | |
parent | eb68b396be51c98e9e9a9027f8b1bb9b05e692c0 (diff) | |
download | genenetwork2-d1192b1f244e8976fb53c260179eb3715029ebf4.tar.gz |
gn_server: introduced one new query to fetch a dataset record and force fetch1 to return a tuple
Diffstat (limited to 'wqflask/db/call.py')
-rw-r--r-- | wqflask/db/call.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/wqflask/db/call.py b/wqflask/db/call.py index 194a7650..6c195afa 100644 --- a/wqflask/db/call.py +++ b/wqflask/db/call.py @@ -14,17 +14,19 @@ logger = getLogger(__name__ ) # from inspect import stack def fetch1(query, path=None, func=None): - """Fetch one result using either a SQL query or the URI path to -GN_SERVER (when USE_GN_SERVER is True). Apply func to GN_SERVER result -when set. + """Fetch one result as a Tuple using either a SQL query or the URI +path to GN_SERVER (when USE_GN_SERVER is True). Apply func to +GN_SERVER result when set (which should return a Tuple) """ if USE_GN_SERVER and path: result = gn_server(path) if func != None: - return [func(result)] + res2 = func(result) else: - return [result] + res2 = result, + logger.debug(path,query,res2) + return res2 else: return fetchone(query) |