Skip to content

Instantly share code, notes, and snippets.

@akoumjian
Created January 17, 2012 08:17
Show Gist options
  • Save akoumjian/1625609 to your computer and use it in GitHub Desktop.
Save akoumjian/1625609 to your computer and use it in GitHub Desktop.
Celery Task as Tastypie One Use Resource
@task
def temp_resource(foo, bar):
"""
Generate a temporary resource for use in Tastypie
"""
value1 = foo**2
value2 = foo * bar
return {'field_one': value1, 'field_two': value2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment