[Flask] Form with no validators failing validation
Alex Hall
ahall at autodist.com
Mon Apr 25 16:01:44 EDT 2016
On Mon, Apr 25, 2016 at 3:52 PM, Andrea D'Amore <and.damore at gmail.com>
wrote:
> On 25 April 2016 at 20:48, Alex Hall <ahall at autodist.com> wrote:
> > searchForm = OrderSearchForm()
> > #now that the form is constructed, we can set the label text properties
> of
> > the elements
> > searchForm.orderNumber.label.text = "Order number to search for"
> […]
> > searchForm.hasErrors.label.text = "Only orders with errors"
>
> Out of curiosity, why setting the labels in the view?
>
Because it worked. I know there must be an easier way, but I couldn't set
it right in the form class as the properties didn't exist yet and so lacked
the label property. I've just never bothered to look at how else to do it,
but I'm sure there's a better way.
>
>
> --
> Andrea
>
--
Alex Hall
Automatic Distributors, IT department
ahall at autodist.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160425/215e8f97/attachment-0001.html>
More information about the Flask
mailing list