PEP8 cleanups, style cleanups, unused imports

This commit is contained in:
Roberto Rosario
2012-01-18 13:52:19 -04:00
parent 1a285d56dc
commit 8a5d0425b6
42 changed files with 311 additions and 335 deletions

View File

@@ -1,4 +1,4 @@
'''Common abstract classes for forms.'''
"""Common abstract classes for forms."""
try:
import cPickle as pickle
except ImportError:
@@ -15,13 +15,13 @@ __all__ = ('security_hash', 'BoundFormWizard')
def security_hash_new(form, exclude=None, *args):
'''
"""
Calculates a security hash for the given Form/FormSet instance.
This creates a list of the form field names/values in a deterministic
order, pickles the result with the SECRET_KEY setting, then takes an md5
hash of that.
'''
"""
data = []
if exclude is None:
@@ -52,20 +52,20 @@ def security_hash_new(form, exclude=None, *args):
class BoundFormWizard(FormWizard):
'''
"""
Render prev_fields as a list of bound form fields in the template
context rather than raw html.
'''
"""
def security_hash(self, request, form):
'''
"""
Calculates the security hash for the given HttpRequest and
Form/FormSet instances.
Subclasses may want to take into account request-specific information,
such as the IP address.
'''
"""
return security_hash_new(form)
def render(self, form, request, step, context=None):