brutus / wtforms-html5 Goto Github PK
View Code? Open in Web Editor NEWHTML5 widgets for WTForms
License: GNU General Public License v3.0
HTML5 widgets for WTForms
License: GNU General Public License v3.0
i am installing the packeg on my raspi, i cloned the repository.
when i run setup.cfg it just goes side ways
File "/home/pi/wtforms-html5/setup.cfg", line 3
version = 0.4.0
^
SyntaxError: invalid syntax
Having an issue with a DateField where it always fails validation and triggers an error regardless of input.
close_date = DateField('Date Opportunity Closed', format='%d-%m-%Y', validators=[DataRequired()])
The validation constraints are defined on MDN.
i have a datefield in my web application, i used wtf-html5 to create the form
But form.validate always returns false.
here is my snippet
app/forms.py
class ProfileForm(Form):
entrydate = DateField(
'entrydate',
format = '%d%m%Y'
)
app/views.py
@app.route('/profile', methods = ['GET','POST'])
def profile():
if request.method == 'POST':
if form.validate():
return form.entrydate.data
return 'bad form'
return render_template('profile.html',form=form)
it keeps returning bad form
I am using a MonthInput
in the following way:
from flask_wtf import FlaskForm
from wtforms.fields import html5 as h5fields
from wtforms.widgets import html5 as h5widgets
class ImportForm(FlaskForm):
month = h5fields.DateField("Month", widget=h5widgets.MonthInput(), validators=[DataRequired()])
submit = SubmitField("Import")
However, when I submit the form with a value, the value is empty:
if form.validate_on_submit():
pass
else:
print(form.errors) # {'month': ['This field is required.']}
Why is this value not being passed correctly?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.