wtforms Questions
5
Here they say it's not supported out of the box.
Do you know a way to make HTML input form fields use the 'readonly' attribute with WTForms?
Stipulation asked 7/3, 2012 at 10:17
5
I'm trying to produce a dynamic checkbox list with certain boxes checked based on the state of the data.
Here's my Form:
class FooForm(Form):
bar = SelectMultipleField(
'Bar',
option_widget=Ch...
18
Getting exception when running the following code for form validation.
File "/Users/homeduvvuri/Documents/Learning/PartyGoUdemy/PartGo/user/forms.py", line 11, in BaseUserForm
email = EmailField...
5
Solved
I have the following code and I'm submitting a form. When I hit the submit button, my form validation prints out False. I've checked and made sure I'm including everything from different posts, but...
Lyndsaylyndsey asked 6/4, 2016 at 1:42
2
Solved
I'm building a website with the Python Flask framework in which I use WTForms. In one form I've got a RadioField defined as follows:
display = RadioField('display', default='ONE')
This does not ...
10
Solved
I'm using Flask-WTF:
Here is my form:
from flask.ext.wtf import Form, TextField
class BookNewForm(Form):
name = TextField('Name')
Here is the controller:
@book.route('/book/new', methods=['G...
Penultimate asked 23/5, 2012 at 15:18
2
Does anyone know of a way to create a datalist field using WTForms in Flask?
I know how to create a SelectField but I need to allow the user to enter their own value if it isn't in the list.
This...
Gillum asked 27/1, 2016 at 22:47
5
Solved
I'm generating a dynamic form using wtforms (and flask). I'd like to add some custom css classes to the fields I'm generating, but so far I've been unable to do so. Using the answer I found here, I...
3
Solved
I want to add or remove new WTForm input fields with button, using Jquery, just like here
http://www.sanwebe.com/2013/03/addremove-input-fields-dynamically-with-jquery/comment-page-1
but using my f...
Assuntaassur asked 28/5, 2014 at 14:58
3
class AddProductForm(FlaskForm):
product_pictures = MultipleFileField('Pictures')
submit = SubmitField('Add Pictures')
def product_add_pics():
form = AddProductForm()
if form.validate_on_subm...
Hydrometer asked 27/10, 2018 at 11:56
2
Solved
I have a multi-part form to generate - think similar workflow to a Shopping Cart where you have multiple "sections" (eg details, billing, payment etc) for the one form that display one at a time.
...
Hinson asked 18/11, 2015 at 0:6
3
Solved
I have a flask + wtforms app where I want users to be able to input both a parent object, and an arbitrary number of child objects. I'm not sure what the best way to dynamically create new child fo...
Linnlinnaeus asked 13/8, 2018 at 7:24
4
Solved
My form validation is working nearly complete, I just have 2 cases I don't know exactly how to solve: 1) The password field should be required of course but I also provide the possibility to log in...
Swanson asked 11/12, 2011 at 10:8
9
Solved
When attempting to set the default value of a SelectField with WTForms, I pass in value to the 'default' parameter like so.
class TestForm(Form):
test_field = SelectField("Test: ", choices=[(1, "...
2
Solved
I have this field in the WTForms form
name = StringField('Name', validators = [Optional(), Length(max = 100)])
When the field is submitted empty then form.name.data will, as expected, contain an...
Ilona asked 17/2, 2014 at 14:8
3
How can I set FileSizeLimit validation for flask_wtf.file.FileField?
Littman asked 20/4, 2021 at 4:22
3
Solved
I am stumped on testing a POST to add a category to the database where I've used Flask_WTF for validation and CSRF protection. For the CRUD operations pm my website. I've used Flask, Flask_WTF and ...
Ish asked 1/6, 2016 at 21:52
3
Solved
I have created a signup form using wtforms. I am using FormField in it so that I don't have to repeat some of the elements of the form again. But whenever I click on the Submit button it always giv...
Stamin asked 10/9, 2013 at 10:49
1
I am trying to figure out a way to check if there is any built-in Form method that would return true if the form has been modified in Flask/WTForms
I know that in Django Forms, we have that flexib...
Purdah asked 12/3, 2019 at 5:41
2
Here is my code:
class ChangeOfficialForm(Form):
is_official = SelectField(
'Officially Approved',
choices=[(True, 'Yes'), (False, 'No')],
validators=[DataRequired()],
coerce=bool
)
submit ...
Kaplan asked 30/10, 2015 at 5:52
4
Solved
I want to reset the form after it validates. Currently the form will still show the previous data after it is submitted and valid. Basically, I want the form to go back to the original state with a...
Niemeyer asked 11/8, 2015 at 15:0
6
I defined some WTForms forms in an application that uses SQLALchemy to manage database operations.
For example, a form for managing Categories:
class CategoryForm(Form):
name = TextField(u'name'...
Antiphon asked 16/4, 2011 at 10:15
3
Solved
I'm using virtualenv to set up a new project. I installed a lot of things using virtualenv pip from the script folder like below:
flask\scripts\pip install Flask-WTF
I have no other packages ins...
Slab asked 18/8, 2013 at 8:10
3
I am writing some basic tests and have a test failing.
def test_new_user_registration(self):
self.client.get('/user/register')
form = RegistrationForm(
email=u'[email protected]',
first_n...
Heterography asked 4/7, 2014 at 16:12
4
Solved
I currently am creating a dynamic select field using WTFORMS, however it never submits and fails the validation with the following error.
Not a valid choice
My Field is created like this:
area ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.