def make_secret(form_instance, secret_fields=None):
 from django.contrib.auth.models import get_hexdigest
 if (secret_fields is None):
  secret_fields = ['business', 'item_name']
 data = ''
 for name in secret_fields:
  if hasattr(form_instance, 'cleaned_data'):
   if (name in form_instance.cleaned_data):
    data += unicode(form_instance.cleaned_data[name])
  elif (name in form_instance.initial):
   data += unicode(form_instance.initial[name])
  elif ((name in form_instance.fields) and (form_instance.fields[name].initial is not None)):
   data += unicode(form_instance.fields[name].initial)
 secret = get_hexdigest('sha1', settings.SECRET_KEY, data)
 return secret

def make_secret ( form_instance , secret_fields = None ) : from django . contrib . auth . models import get_hexdigest if ( secret_fields is None ) : secret_fields = [ 'business' , 'item_name' ] data = '' for name in secret_fields : if hasattr ( form_instance , 'cleaned_data' ) : if ( name in form_instance . cleaned_data ) : data += unicode ( form_instance . cleaned_data [ name ] ) elif ( name in form_instance . initial ) : data += unicode ( form_instance . initial [ name ] ) elif ( ( name in form_instance . fields ) and ( form_instance . fields [ name ] . initial is not None ) ) : data += unicode ( form_instance . fields [ name ] . initial ) secret = get_hexdigest ( 'sha1' , settings . SECRET_KEY , data ) return secret
returns a secret for use in a ewp form or an ipn verification based on a selection of variables in params .