wtforms Questions

1

Solved

I've been biting my nails on this one for quite some time. In my Flask-app I currently have a product-database, for which in the app I have a page that queries each product column into a table. F...
Primal asked 3/1, 2018 at 18:15

4

Solved

I am rather new to WTForms, Flask-WTF. I can't figure out how to simply add the HTML5 attribute "autofocus" to one of the form field, from the form definition. I would like to do that in the Python...
Phantasy asked 12/8, 2015 at 15:8

2

Solved

Calling a WTForms field object produces the rendered field, and any arguments are taken as attributes, for instance. form.field(attribute='value') would return something like <input attribut...
Damicke asked 5/9, 2012 at 15:22

5

Solved

This is a question upon the use of wtforms SelectField. Once the form submitted, I wish to extract selected text. I have the following form: from wtforms import Form, SelectField class TestForm...
Levin asked 19/1, 2014 at 13:39

0

I'm getting this error only when the field is defined in a form that contains other fields- but when its defined in a it's own form, this error is not generated and it works. Firstly I will show ...
Combatant asked 24/8, 2017 at 16:23

1

Solved

Most of the info I find online is for multiple checkboxes. I just want 1. I have: class CategoryForm(FlaskForm): category = StringField('category',validators=[DataRequired()]) checkbox = Bool...
Szombathely asked 10/8, 2017 at 0:28

1

i have a form that uses a widget. what i want is two vertical columns side by side with the checkboxes. class MultiCheckboxField(SelectMultipleField): widget = widgets.ListWidget(prefix_label=Fal...
Phio asked 18/7, 2017 at 23:42

1

I am having troubles with form validation. The country list is generated correctly, and previous forms worked fine. It is only breaking in POST requests. Here is my forms.py: from wtforms import ...
Galingale asked 10/5, 2017 at 11:56

1

Solved

I want to define a form class with fields based on a dict of name: label. I tried the following, which nearly worked. However, rendering the fields in a template gave AttributeError: 'UnboundField'...
Knute asked 9/5, 2017 at 2:16

2

OK. I know this has been tackled many times but I can't find an answer with a useful example of javascript to use. Say I have this form: class MyForm(Form): category = SelectField("Category") i...
Appointed asked 5/1, 2016 at 18:39

4

Solved

First, I'm new to python and Flask, so I'm sorry if my question is dumb. I search it but never found an answer (which should be an "easy" one I guess). I wanted to add a contact page in my website...
Thill asked 3/1, 2014 at 13:52

1

Solved

I have a WTF SelectField, and I'm trying to store the name of the user's choice for display on another page. Given that my form is choice = SelectField('Choice', choices=[('cho_1', 'Choice ...
Prosecute asked 28/3, 2017 at 13:44

2

Solved

I need to generate my fields in the constructor of the form since the number of fields needed can vary. I think my current solution is the problem. I get an exception when I try to expand the form ...
Palma asked 1/7, 2015 at 12:4

3

Solved

I have a template which allows the user to edit their user information. <form method="post"> <table> <tr> <td>Username:</td> <td>{{user['username']}}</td...
Pottage asked 1/6, 2011 at 5:18

3

Solved

I've got my Pylint install importing flask just fine. And with that same installation of flask, I have wtforms running just fine in my application. However, when I run Pylint on a file importing wt...
Requirement asked 17/4, 2013 at 13:34

2

Solved

How do I get the data from a WTForms form after submitting it? I want to get the email entered in the form. class ApplicationForm(Form): email = StringField() @app.route('/', methods=['GET', 'PO...
Pfister asked 1/12, 2016 at 16:53

2

Solved

I am using Flask to develop a web application. I was originally doing HTML forms manually, and then switched over to using WTForms (this is an educational project, so I am showing each step of buil...
Grotesquery asked 10/1, 2016 at 13:30

1

Solved

I want to create different forms in Flask using WTForms and Jinja2. I make a call to mysql, which has the type of field. So i.e. the table could be: form_id | type | key | options | default_val...
Asylum asked 22/9, 2016 at 13:9

1

Solved

I have experience with PHP but im new to Flask and Python and I need help with a simple thing. I have a database table and I need each entry in a radio button. I need to use WTForms but I can't do...
Expertism asked 8/7, 2016 at 2:17

2

I have an empty select field that has choices that I define during run time: myfield = SelectField('myfield', validators=[Optional()]) I'm trying to have this work with a GET request which looks...
Landholder asked 17/2, 2016 at 15:3

1

Solved

The following flask code creates a select .. option dropdown menu: model: class SelectForm(Form): country = SelectField('Country', choices=[ ('us','USA'),('gb','Great Britain'),('ru','Russia')]...
Extrusive asked 23/6, 2016 at 23:59

2

Solved

I have a select field that has certain elements faded and disabled that I would like to render with WTForms: <select name="cg" id="cat" class="search_category"> <option value='' >{% tr...
Delate asked 11/12, 2011 at 10:58

2

Solved

I wrote an SQL query which uses data passed in from WTForms as parameters. How do I ensure double quotes on the variable? q = """ select * from table where dt_date >= %(date)s""" % {'date':dat...
Unbeatable asked 23/6, 2016 at 13:13

3

Solved

Simple form: class AdjustPWMForm(Form): dutyCycle = IntegerField('dutycycle') #dutyCycle = IntegerField('dutycycle', default=44) View function: def adjust(): user = g.user form = AdjustPWM...
Tafoya asked 13/10, 2014 at 15:12

4

Solved

is there a way i could send a form's (css) class from python? For example: class Company(Form): companyName = TextField('Company Name', [validators.Length(min=3, max = 60)]) This renders a simp...
Glenoid asked 3/7, 2012 at 11:16

© 2022 - 2024 — McMap. All rights reserved.