Skip to content

Instantly share code, notes, and snippets.

@slomo
Created April 27, 2017 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slomo/1e9d62ec9a362e86f7b667bcaab518a4 to your computer and use it in GitHub Desktop.
Save slomo/1e9d62ec9a362e86f7b667bcaab518a4 to your computer and use it in GitHub Desktop.
if action = "create":
project = instance.project
if 'action_target' in instance._meta.action_target:
action.target = getattr(instance, instance._meta.action_target)
if 'content_object' in instance:
action.traget = instance.content_object
if 'module' in instance:
action.target = instance.module
elif action = "update":
project.instance = project
action.object = instance
action.target = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment