Skip to content

Commit 85c84bf

Browse files
committed
fix bug
1 parent 6dffdba commit 85c84bf

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

pharus/component_interface.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self, *args, **kwargs):
9090
self.vm_list = [
9191
dj.VirtualModule(
9292
s,
93-
s,
93+
s.replace("__", "-"),
9494
connection=self.connection,
9595
)
9696
for s in inspect.getfullargspec(self.dj_query).args
@@ -100,10 +100,6 @@ def __init__(self, *args, **kwargs):
100100
def fetch_metadata(self):
101101
return self.dj_query(*self.vm_list)
102102

103-
@property
104-
def GET_mimetype(self):
105-
return self.response_mimetype
106-
107103
@property
108104
def restriction(self):
109105
# first element includes the spec's restriction,
@@ -181,14 +177,6 @@ def __init__(self, *args, **kwargs):
181177
}
182178
self.input_lookup = {v: k for k, v in self.destination_lookup.items()}
183179

184-
@property
185-
def GET_mimetype(self):
186-
return self.get_response_mimetype
187-
188-
@property
189-
def POST_mimetype(self):
190-
return self.post_response_mimetype
191-
192180
def dj_query_route(self):
193181
with self.connection.transaction:
194182
for t in self.tables:

pharus/dynamic_api_gen.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def {method_name}(connection: dj.Connection) -> dict:
3838
static_config={static_config},
3939
connection=connection,
4040
{payload})
41-
return Response(response=component_instance.{method_name_type}(),
42-
status=200,
43-
mimetype=component_instance.{rest_verb}_mimetype)
41+
return component_instance.{method_name_type}()
4442
except Exception as e:
4543
return traceback.format_exc(), 500
4644
"""
@@ -60,9 +58,7 @@ def {method_name}() -> dict:
6058
static_config={static_config},
6159
connection=connection,
6260
{payload})
63-
return Response(response=component_instance.{method_name_type}(),
64-
status=200,
65-
mimetype=component_instance.{rest_verb}_mimetype)
61+
return component_instance.{method_name_type}()
6662
except Exception as e:
6763
return traceback.format_exc(), 500
6864
"""

0 commit comments

Comments
 (0)