Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Create tree field with pk in dims resource
Browse files Browse the repository at this point in the history
This fixes the case where calls to cached methods would fail during cache key construction because the pk was missing.

Signed-off-by: Don Naegely <naegelyd@gmail.com>
  • Loading branch information
naegelyd committed Dec 3, 2014
1 parent acb8c4c commit dfe386e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion serrano/resources/field/dims.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def get(self, request, pk):

tree = trees[params.get('tree')]
opts = tree.root_model._meta
tree_field = DataField(app_name=opts.app_label,
tree_field = DataField(pk='{}:{}'.format(tree, pk),
app_name=opts.app_label,
model_name=opts.module_name,
field_name=opts.pk.name)

Expand Down

0 comments on commit dfe386e

Please sign in to comment.