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 AutoCompleteResourceMixin(ResourceMixin): | |
def validate_request(self, data, files=None): | |
""" | |
Auto-complete objects when they are created. | |
A REST equivalent to auto-populate for Django web forms. | |
""" | |
method = self.view._method if hasattr(self.view, '_method') else None |
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 AuthenticatedUserResourceMixin(ResourceMixin): | |
permissions = (IsAuthenticated,) | |
def build_query(self, *args, **kwargs): | |
tmp = dict(kwargs) | |
if BaseRenderer._FORMAT_QUERY_PARAM in tmp: | |
del tmp[BaseRenderer._FORMAT_QUERY_PARAM] |
NewerOlder