Skip to content

Commit

Permalink
Merge 80ba405 into 42cc475
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Jul 1, 2016
2 parents 42cc475 + 80ba405 commit 6bb8d59
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 106 deletions.
31 changes: 0 additions & 31 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,6 @@ Forms and Fields

.. autoclass:: FileRequired

.. module:: flask_wtf.html5

.. autoclass:: SearchInput

.. autoclass:: SearchField

.. autoclass:: URLInput

.. autoclass:: URLField

.. autoclass:: EmailInput

.. autoclass:: EmailField

.. autoclass:: TelInput

.. autoclass:: TelField

.. autoclass:: NumberInput

.. autoclass:: IntegerField

.. autoclass:: DecimalField

.. autoclass:: RangeInput

.. autoclass:: IntegerRangeField

.. autoclass:: DecimalRangeField


CSRF Protection
---------------

Expand Down
18 changes: 0 additions & 18 deletions docs/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,6 @@ to :class:`FileAllowed`::
FileAllowed(['jpg', 'png'], 'Images only!')
])

HTML5 Widgets
-------------

.. note::

HTML5 widgets and fields are builtin of wtforms since 1.0.5. You
should consider import them from wtforms if possible.

We will drop html5 module in next release 0.9.3.

You can import a number of HTML5 widgets from ``wtforms``::

from wtforms.fields.html5 import URLField
from wtforms.validators import url

class LinkForm(Form):
url = URLField(validators=[url()])


.. _recaptcha:

Expand Down
9 changes: 9 additions & 0 deletions flask_wtf/html5.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# coding: utf-8
# flake8: noqa
import warnings
from flask_wtf._compat import FlaskWTFDeprecationWarning

warnings.warn(FlaskWTFDeprecationWarning(
'"flask_wtf.html5" will be removed in 1.0. '
'Import directly from "wtforms.fields.html5" '
'and "wtforms.widgets.html5".'
), stacklevel=2)

from wtforms.widgets.html5 import *
from wtforms.fields.html5 import *
9 changes: 5 additions & 4 deletions tests/test_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

class TestForm(TestCase):
def test_deprecated_form(self):
def define_deprecated_form():
class F(Form):
pass
with warnings.catch_warnings():
warnings.simplefilter('error', FlaskWTFDeprecationWarning)
self.assertRaises(FlaskWTFDeprecationWarning, type, 'F', (Form,), {})

def test_deprecated_html5(self):
with warnings.catch_warnings():
warnings.simplefilter('error', FlaskWTFDeprecationWarning)
self.assertRaises(FlaskWTFDeprecationWarning, define_deprecated_form)
self.assertRaises(FlaskWTFDeprecationWarning, __import__, 'flask_wtf.html5')
53 changes: 0 additions & 53 deletions tests/test_html5.py

This file was deleted.

0 comments on commit 6bb8d59

Please sign in to comment.