Skip to content

Instantly share code, notes, and snippets.

@bohde
Created February 23, 2011 20:44
Show Gist options
  • Save bohde/841150 to your computer and use it in GitHub Desktop.
Save bohde/841150 to your computer and use it in GitHub Desktop.
class HiddenFieldResource(ModelResource):
secret = fields.CharField(help_text="Public lookup key.")
def hydrate_secret(self, bundle):
lookup_key = bundle.obj.secret
bundle.obj.secret = lookup_secret(lookup_key)
return bundle
def dehydrate_secret(self, bundle):
bundle.data['secret'] = bundle.obj.secret.lookup_key
return bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment