Skip to content

Instantly share code, notes, and snippets.

@bohde
Created December 24, 2010 15:10
Show Gist options
  • Save bohde/754323 to your computer and use it in GitHub Desktop.
Save bohde/754323 to your computer and use it in GitHub Desktop.
Running logic on update in tastypie
from tastypie.resources import ModelResource
class FlaggedResource(ModelResource):
def obj_update(self, bundle, request=None, **kwargs):
processFlag = bundle.obj and not bundle.obj.flagged
bundle = super(FlaggedResource, self).obj_update(bundle, request, **kwargs)
if processFlag:
bundle.obj.flagLogic()
return bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment