Created
March 8, 2012 22:13
-
-
Save gourneau/2003796 to your computer and use it in GitHub Desktop.
tastypie simplest possible non orm resource
This file contains hidden or 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 Update(Resource): | |
| def override_urls(self): | |
| urls = [url(r"^(?P<resource_name>%s)%s$" % (self._meta.resource_name, trailing_slash()), | |
| self.wrap_view('dispatch_update'), name="api_dispatch_update") | |
| ] | |
| return urls | |
| def dispatch_update(self, request, **kwargs): | |
| return self.dispatch('update', request, **kwargs) | |
| def get_update(self, request, **kwargs): | |
| updateStatus = {} | |
| return self.create_response(request, updateStatus) | |
| class Meta: | |
| authentication = Authentication() | |
| authorization = Authorization() | |
| update_allowed_methods = ['get'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment