Skip to content

Commit 46f6fd1

Browse files
committed
fix reference with relative path
1 parent 1395e36 commit 46f6fd1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: uliweb_apijson/apijson/views.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def _apply_vars(self):
3636
if v:
3737
self.rdict[key[:-1]] = v
3838

39-
def _ref_get(self,path,context={}):
39+
def _ref_get(self,path,context=None):
40+
if context==None:
41+
context = {}
4042
if path[0]=="/":
4143
#relative path
4244
c = context
@@ -143,7 +145,7 @@ def _get_one(self,key):
143145
ref_fields.append(n)
144146
col_name = n[:-1]
145147
path = params[n]
146-
refs[col_name] = self._ref_get(path)
148+
refs[col_name] = self._ref_get(path,context=self.rdict)
147149
for i in ref_fields:
148150
del params[i]
149151
params.update(refs)

0 commit comments

Comments
 (0)