Skip to content

Commit

Permalink
Version bump (major)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfdebrux committed Jun 6, 2018
1 parent df17a85 commit 5815b65
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@

Records breaking changes from major version bumps

## 39.0.0

PR [#400](https://github.com/alphagov/digitalmarketplace-utils/pull/400)

This bump introduces new classes for using WTForms with the frontend toolkit in a way that is unambiguous. This is not a breaking change, but apps which use this version of `dmutils` should aim to use this new feature everywhere where WTForms is used so that our code is consistent across the board.

Old code:
```
# app/main/forms/form.py
from flask_wtf import FlaskForm
from dmutils.forms import StripWhitespaceStringField
class NameForm(FlaskForm):
full_name = StripWhitespaceStringField()
--
# app/templates/name.html
{%
with
name = "full_name",
question = "What is your name?",
hint = "Enter your full name.",
value = form.full_name.data,
error = errors.get("full_name", {}).get("message", None)
%}
```


New code:
```
# app/main/forms/form.py
from flask_wtf import FlaskForm
from dmutils.forms.dm_fields import DMStripWhitespaceStringField
class NameForm(FlaskForm):
full_name = DMStripWhitespaceStringField(
"What is your name?",
hint="Enter your full name.")
--
# app/templates/name.html
{%
with
name = form.full_name.name,
question = form.full_name.question,
hint = form.full_name.hint,
value = form.full_name.value,
error = form.full_name.error
%}
```


## 38.0.0

PR [#397](https://github.com/alphagov/digitalmarketplace-utils/pull/397)
Expand Down
2 changes: 1 addition & 1 deletion dmutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
import flask_featureflags # noqa


__version__ = '38.2.0'
__version__ = '39.0.0'

0 comments on commit 5815b65

Please sign in to comment.