Skip to main content

All Questions

Tagged with
0 votes
1 answer
28 views

How to use FileField within WTForms FieldList? Using Flask-WTF for FileField

I have created dynamic fields using WTForms FieldList, macros and Javascript. Using this code to validate many fields (StringField, SelectField etc) I can add many fields dynamically, and they ...
Artistica Digital's user avatar
1 vote
0 answers
16 views

How to create multi-option BooleanField in wtforms under one label and a select all option with bootstrap-flask

I wanted to make a multi-option wtforms.BooleanField with one label in wtforms, flask_wtf this is the piece of code that I wrote: class InventoryRecorder(flask_wtf.FlaskForm): all_season = wtforms....
Besmella Kazimy's user avatar
0 votes
0 answers
21 views

Flask route params not being correctly passed when using wtf form

I have a route defined in a flask blueprint: @bp.route('/comparison', defaults={'category':'chatarra'}, methods=['GET']) @bp.route('/comparison/<string:category>', methods=['GET']) def ...
Milo2020's user avatar
0 votes
1 answer
29 views

Show the value of IntegerRangeField next to the slider WTForms Python Flask

I have made a form which contains an IntegerRangeField and I want to have a number next to the slider which shows the value of the slider and updates it as it changes. Form class class ...
Nicholas Day's user avatar
0 votes
0 answers
15 views

How can I test a post request to a wtform that uses FormField in flask?

I'm trying to write tests to see if a form is posting data properly. Specifically I'm trying to test that form data (name and phone_number) are being sent to a contact info form for takeout. I keep ...
Drumkit's user avatar
0 votes
1 answer
48 views

Flask WTForms application creates file to download. Users getting someone else's file (same name). How to fix?

My application creates a file in the server from input on a WTForms. The file name never changes. As a new user comes in, fills out the form and and the old file is overwritten. Problem is when 2 ...
chepox's user avatar
  • 47
0 votes
0 answers
100 views

Exception: Install 'email_validator' for email validation support

I tried uninstalling and installing email_validator many a times, yet it is showing the same error. Below is the list of installed libraries. pip list Package Version --------------- ----------...
dev's user avatar
  • 101
0 votes
2 answers
59 views

Avoid form submitting twice if user quickly clicks submit buttons two times

I've been struggling with this one and I can't get a proper answer. Disabling the button after click doesn't help because it needs to be working in case of not valid request. Shouldn't the form ...
Cristian Cassetta's user avatar
0 votes
0 answers
23 views

WTForms doesn't raise any validation error

I made a basic login page with flask and wtforms. But the validators' errors aren't displaying on the page even though I think I correctly wrote the code. I first made a wtforms class LoginForm that ...
Absolute Reality's user avatar
0 votes
0 answers
29 views

In flask wtf forms MultipleCheckboxField, how to set different attributes to each checkbox choice?

How to set html attributes to each of the checkbox choices (key and value) (different for each choice)? My code: class MultipleCheckboxField(SelectMultipleField): widget = ListWidget(prefix_label=...
BONAFIDE BOSS's user avatar
0 votes
0 answers
33 views

Dynamically change CSS styles of input field upon successful validation without submitting form

I'm trying to figure out how to dynamically update the CSS styles of an input field as soon as it successfully validates, without requiring a form submission. Currently, I can only trigger validation ...
thegigabyte's user avatar
0 votes
2 answers
70 views

Conditionally apply CSS class to wtforms element in Python flask

I want to apply an additional is-invalid CSS class to a wtforms element only if there is an error present in the form. I've landed on the following code to achieve this and it works: {% if form.email....
Dean Wild's user avatar
  • 5,935
0 votes
1 answer
14 views

set html lang value on flask

I would like to find a way to set the <html lang='en'> attribute value. Right now the root html template is being extracted from the flask libraries {% extends "bootstrap/base.html" %} ...
celerno's user avatar
  • 1,387
0 votes
1 answer
110 views

How would I pytest a flask wtforms custom validator?

I tried the code below. But the problem is I am getting an error when I run the code. Do I have the right arguments in make_password_contain_capital? Here is the custom validator. auth/functions.py ...
jrgop's user avatar
  • 3
0 votes
0 answers
34 views

Flask Python WTForms ignoring custom styling in style sheet

Running Flask Python on an OpenSuSE machine and I have this html template, which displays a single-dropdown list and a password field along with a 'Connect' button. I would like to customize the '...
quarksrus's user avatar

15 30 50 per page
1
2 3 4 5
76