Skip to content
Merged

Sync #39

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix reference with relative path
  • Loading branch information
zhangchunlin committed Oct 9, 2019
commit 46f6fd1c4de9b62db6fff0d61f3884ab8a1a4fe4
6 changes: 4 additions & 2 deletions uliweb_apijson/apijson/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def _apply_vars(self):
if v:
self.rdict[key[:-1]] = v

def _ref_get(self,path,context={}):
def _ref_get(self,path,context=None):
if context==None:
context = {}
if path[0]=="/":
#relative path
c = context
Expand Down Expand Up @@ -143,7 +145,7 @@ def _get_one(self,key):
ref_fields.append(n)
col_name = n[:-1]
path = params[n]
refs[col_name] = self._ref_get(path)
refs[col_name] = self._ref_get(path,context=self.rdict)
for i in ref_fields:
del params[i]
params.update(refs)
Expand Down