Hi All,
I'm pretty new in the Pyramid world and still in the learning process.
My question is about the forms generation and validation libraries, is there a really good one usable with Pyramid AND with good documentation ? For the few last days, I was trying pretty hard to have something working with some of those libraries but I'm at the point where nothing works like I would like.
I've tried Deform but I really have problems with the errors, I mean, I find pretty hard to define customized error messages, i.e., you want to generate a login page, this login page must be able to display an error message above the box if the user/password combination is not valid (or another error is occuring). It's pretty easy to get rid of the huge box above the form (There was a problem with your submission, Errors have been highlighted below)(changing the template used), but I'm not able to replace this box by a customized error message that can depend of the error (and keeping also the individual messages for each field (i.e: Required) or changing easily those individual error messages.
I've also tried the ToscaWidget2 Lib, the problem I had with this one are: I'm not able to use the i18n, I'm not able to get the tooltips on the fields and the doc is not very very useful (or complete :'( )
I've also tried another one (don't remember, I think it was WTForms) but if I remember well, I had problems also with the i18n.
So, as I'm loosing a lot of time (let's say about 3-4 days) trying the different libraries, reading the docs, reading the sources (i.e., trying to understand what are the possible parameters for TW2 widgets), and not having exactly what I want, I ask to the list, do you know about a form generation and validation lib, with support for i18n, easy error customization, and ability to use all (or almost all) html attributes (i.e. the title attribute to have tooltips in recent browsers).
If some of you don't use at all such a library, do you have a good pointer to resources to validate input in a safe and clean way by hand ?
Thank a lot for your comments and ideas.
Have a nice day,
Nicolas
PS: maybe I missed the features of deform and tw2 (and WTForms), I'm sorry if I offense the different authors of those libs and even if what I want/need is not in their libs, I want to say thanks for each bit of the open-source ecosystem.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/sXm8e2r1R-IJ.
To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
strongly advise WTForms. IMHO it's flexible and powerfull, can generate forms for SQLAlchemy models, can work with JSON request data (via wtforms_json), well documented, small readable code base (if docs miss), and have no i18n problem for me.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/-Db3O8yR9QcJ.
To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
Hi All,
I'm pretty new in the Pyramid world and still in the learning process.
My question is about the forms generation and validation libraries, is there a really good one usable with Pyramid AND with good documentation ? For the few last days, I was trying pretty hard to have something working with some of those libraries but I'm at the point where nothing works like I would like.
I've tried Deform but I really have problems with the errors, I mean, I find pretty hard to define customized error messages, i.e., you want to generate a login page, this login page must be able to display an error message above the box if the user/password combination is not valid (or another error is occuring). It's pretty easy to get rid of the huge box above the form (There was a problem with your submission, Errors have been highlighted below)(changing the template used), but I'm not able to replace this box by a customized error message that can depend of the error (and keeping also the individual messages for each field (i.e: Required) or changing easily those individual error messages.
I've also tried the ToscaWidget2 Lib, the problem I had with this one are: I'm not able to use the i18n, I'm not able to get the tooltips on the fields and the doc is not very very useful (or complete :'( )
I've also tried another one (don't remember, I think it was WTForms) but if I remember well, I had problems also with the i18n.
So, as I'm loosing a lot of time (let's say about 3-4 days) trying the different libraries, reading the docs, reading the sources (i.e., trying to understand what are the possible parameters for TW2 widgets), and not having exactly what I want, I ask to the list, do you know about a form generation and validation lib, with support for i18n, easy error customization, and ability to use all (or almost all) html attributes (i.e. the title attribute to have tooltips in recent browsers).
If some of you don't use at all such a library, do you have a good pointer to resources to validate input in a safe and clean way by hand ?
Thank a lot for your comments and ideas.
Have a nice day,
Nicolas
PS: maybe I missed the features of deform and tw2 (and WTForms), I'm sorry if I offense the different authors of those libs and even if what I want/need is not in their libs, I want to say thanks for each bit of the open-source ecosystem.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/sXm8e2r1R-IJ.
Anyway, not that popular yet, but I recommend to use YAFOWIL for forms in pyramid. Ok, I'am biased, because I'am one of the authors.
Include the yafowil.webob and yafowil.bootstrap packages and get started. Dcumentation and live-example are at http://yafowil.info
Example registration form here: http://pastebin.com/GFqrZj0r
template has to have i.e.
<div class="row">
<div class="span12">
<h1>Register</h1>
${structure: view.form()}
</div>
Questions? Just ask. I try to help.
regards Jensens
Hey Nicolas,
I had a realization at some point that form libraries ultimately
aren't a joy to work with.
Instead, I wrote `repoze.formapi` (see docs at http://docs.repoze.org/formapi/).
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/ZGZ6LdvGvaMJ.
Hi Chris,
I've tried pyramid_simpleform and it seems to be good but I was not able to get the i18n working (and the doc here http://packages.python.org/pyramid_simpleform/#localization-and-state is not very very specific) I've set the _ method in a State object without any good result.
If I can get it working, I will try to customize the messages but I'm a bit concerned about the developpement of pyramid_simpleform since the dev sounds stopped for more than one year and it was in the process of moving from formencode to colander. I mean, if all the dev I've to do today (at least 4 projects) use i.e. formencode and simple_form and tommorow the dev start again and go with colander... ;-) (in fact, the dev will restart and use colander IF and ONLY IF, i choose to use it with formencode :-D )
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/4HP4hBG4XmUJ.
To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
Hi Jensens,
This sounds nice, but, reading the doc (a bit fast, I've to admit) it sounds like to define new widgets, you have to define it using YAML, right ?