Extract formatters into their own module

We have lots of functions for converting various types of data into
strings to be displayed to the user somewhere.

This commit collects all these functions into their own module, rather
than having them cluttering up `app/__init__.py` or buried amongst
various other things that have ended up in `app/utils.py`.
This commit is contained in:
Chris Hill-Scott
2021-01-06 12:12:01 +00:00
parent 8595fcf01e
commit 7a95e1618e
17 changed files with 473 additions and 442 deletions

View File

@@ -38,7 +38,7 @@ from wtforms import (
from wtforms.fields.html5 import EmailField, SearchField, TelField
from wtforms.validators import URL, DataRequired, Length, Optional, Regexp
from app import format_thousands
from app.formatters import format_thousands, guess_name_from_email_address
from app.main.validators import (
BroadcastLength,
CommonlyUsedPassword,
@@ -60,7 +60,7 @@ from app.models.roles_and_permissions import (
permissions,
roles,
)
from app.utils import guess_name_from_email_address, merge_jsonlike
from app.utils import merge_jsonlike
def get_time_value_and_label(future_time):