Commits

William Wu committed fdce9cc

Add pyramid csrf support

Comments (0)

Files changed (3)

pyramid_wtf/__init__.py

 from . import validators
 from .fields import *
+from .forms import SecureForm
 from wtforms import widgets
 from wtforms.form import Form
 from wtforms.validators import ValidationError
 
-__version__ = '0.0.1'
+__version__ = '0.0.2'
+from wtforms.ext.csrf import SecureForm as _SecureForm
+
+class SecureForm(_SecureForm):
+
+    def generate_csrf_token(self, csrf_context):
+        return csrf_context.get_csrf_token()
 
 setup(
     name='pyramid_wtf',
-    version='0.0.1',
+    version='0.0.2',
     packages=['pyramid_wtf',],
     description='pyramid_wtf provides bindings for the Pyramid web framework to the WTForms library.',
     author='William Wu',