Skip to content

Instantly share code, notes, and snippets.

@gourneau
Created March 8, 2012 22:13
Show Gist options
  • Select an option

  • Save gourneau/2003796 to your computer and use it in GitHub Desktop.

Select an option

Save gourneau/2003796 to your computer and use it in GitHub Desktop.
tastypie simplest possible non orm resource
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