def security_hash(request, form, *args):
 import warnings
 warnings.warn('security_hash is deprecated; use form_hmac instead', PendingDeprecationWarning)
 data = []
 for bf in form:
  if (form.empty_permitted and (not form.has_changed())):
   value = (bf.data or '')
  else:
   value = (bf.field.clean(bf.data) or '')
  if isinstance(value, basestring):
   value = value.strip()
  data.append((bf.name, value))
 data.extend(args)
 data.append(settings.SECRET_KEY)
 pickled = pickle.dumps(data, pickle.HIGHEST_PROTOCOL)
 return md5_constructor(pickled).hexdigest()

def security_hash ( request , form , * args ) : import warnings warnings . warn ( 'security_hash is deprecated; use form_hmac instead' , PendingDeprecationWarning ) data = [ ] for bf in form : if ( form . empty_permitted and ( not form . has_changed ( ) ) ) : value = ( bf . data or '' ) else : value = ( bf . field . clean ( bf . data ) or '' ) if isinstance ( value , basestring ) : value = value . strip ( ) data . append ( ( bf . name , value ) ) data . extend ( args ) data . append ( settings . SECRET_KEY ) pickled = pickle . dumps ( data , pickle . HIGHEST_PROTOCOL ) return md5_constructor ( pickled ) . hexdigest ( )
calculates a security hash for the given form instance .