toastdriven/django-tastypie — Issue #268: problems with UserProfiles
Author: mrbiscuits
Created: 2011-10-18 16:07:04+00:00
State: open

Both approaches outlined here: https://gist.github.com/915978 no longer work aswell as the approach discussed here http://bit.ly/o4ChgH

In fields.py the problem seems to be with ToOneField :621 foreign_obj = getattr(bundle.obj, self.attribute) & line 321 - using the bit.ly method I worked around this by monkeypatching:

try: self.fk_resource = self.get_related_resource(foreign_obj())
except: self.fk_resource = self.get_related_resource(foreign_obj)

on line 631...

I think fixing this so that it works as described in the gists would involve tinkering with ApiField