Refactor list_schema assignment in ApiViews for clarity; comment out unused rec_…

…id handling in get_list method
1 parent aaa076ad
...@@ -57,7 +57,7 @@ class ApiViews(APIView): ...@@ -57,7 +57,7 @@ class ApiViews(APIView):
select_list = {} select_list = {}
list_schema = kwargs.get("list_schema") list_schema = kwargs.get("list_schema")
if not list_schema: if not list_schema:
list_schema = self.list_schema and self.list_schema or self.form_list list_schema = self.list_schema and self.list_schema or None
if not self.columns: if not self.columns:
columns = [] columns = []
...@@ -288,9 +288,9 @@ class ApiViews(APIView): ...@@ -288,9 +288,9 @@ class ApiViews(APIView):
self.req.GET.add('length', "10") self.req.GET.add('length', "10")
if "start" not in self.req.params: if "start" not in self.req.params:
self.req.GET.add('start', "0") self.req.GET.add('start', "0")
rec_id = self.req.matchdict.get('id') # rec_id = self.req.matchdict.get('id')
if rec_id: # if rec_id:
self.req.GET.add('columns[0][search][value]', rec_id) # self.req.GET.add('columns[0][search][value]', rec_id)
return self.get_list(**kwargs) return self.get_list(**kwargs)
def get_custom_render(self, data): def get_custom_render(self, data):
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!