-
-
Save stodge/f1488c2e1fef03d30c26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserResource(ModelResource): | |
def cached_obj_get(self, request=None, **kwargs): | |
if request and 'id' in kwargs and kwargs['id'] == 'self': | |
return request.user | |
return super(UserResource, self).cached_obj_get(request, **kwargs) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment