Hello Everyone, first of all I'd like to thank the developers of Dancer so much. It's a great thing and I love it more from day to day! While I'm new to Dancer, I'm not new to perl, but were using Django as app server for a long time now. Some day I thaught: this has to be done in perl, dammit - and I discovered Dancer. However, I missed one thing, that is the forms module of Django. With forms you can validate user input, and generate forms. Since I didn't find anything near such a thing, I implemented it myself: Dancer::Forms. It does the very same as the Django forms system does: you define some fields, how they shall be validated, feed your template with it, and that's it. Beside user input validation I also added a CSRF protection feature to the module. This one could be better put into a Dancer plugin perhaps, I'm unsure... The name maybe misleading, since Dancer::Forms does in fact not depend on Dancer. So it could be used in other environments as well. I hope it is ok, to put it into the Dancer:: namespace anyway. There's still lots of things to do, like more unit tests, better debugging possibilities and - maybe - some kind of "model forms" sub module, which generates the forms from a dbic definition... Take a look: https://metacpan.org/module/Dancer::Forms best regards, Tom -- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months.
Hi, Thanks for the work ! I'm a bit worried about the fact that it lies under the Dancer namespace, but doesn't depend on Dancer really. Could this be rename to a different module name, and then a new Dancer Plugin be written, that would use it ? dams On 11 January 2012 15:03, T. Linden <tom@linden.at> wrote:
Hello Everyone,
first of all I'd like to thank the developers of Dancer so much. It's a great thing and I love it more from day to day!
While I'm new to Dancer, I'm not new to perl, but were using Django as app server for a long time now. Some day I thaught: this has to be done in perl, dammit - and I discovered Dancer.
However, I missed one thing, that is the forms module of Django. With forms you can validate user input, and generate forms. Since I didn't find anything near such a thing, I implemented it myself: Dancer::Forms.
It does the very same as the Django forms system does: you define some fields, how they shall be validated, feed your template with it, and that's it.
Beside user input validation I also added a CSRF protection feature to the module. This one could be better put into a Dancer plugin perhaps, I'm unsure...
The name maybe misleading, since Dancer::Forms does in fact not depend on Dancer. So it could be used in other environments as well. I hope it is ok, to put it into the Dancer:: namespace anyway.
There's still lots of things to do, like more unit tests, better debugging possibilities and - maybe - some kind of "model forms" sub module, which generates the forms from a dbic definition...
Take a look: https://metacpan.org/module/Dancer::Forms
best regards, Tom
-- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months. _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Linden, this seems like awesome work, way to go! However, along with Damien, I should note that we appreciate not putting modules under Dancer that aren't part of Dancer itself. We recommend the Dancer::Plugin::* namespace. Also, we prefer people wouldn't use generic names. By calling it "Forms" it gives an official sound and people might expect this to be the official and only Dancer forms library. There are definitely more ways (though perhaps not necessarily as good) to have forms - FormFu, for instance. For example, if you call yours Dancer::Plugin::Djangoish or Dancer::Plugin::Forms::Django (just an example), someone else could provide a FormFu forms plugin under Dancer::Plugin::FormFu or Dancer::Plugin::Forms::FormFu. At least consider renaming to the ::Plugin namespace. And thanks for this great contribution. I'll be sure to check the code and perhaps even use it myself. Good work! :) S. On Wed, Jan 11, 2012 at 4:40 PM, damien krotkine <dkrotkine@gmail.com>wrote:
Hi,
Thanks for the work !
I'm a bit worried about the fact that it lies under the Dancer namespace, but doesn't depend on Dancer really. Could this be rename to a different module name, and then a new Dancer Plugin be written, that would use it ?
dams
On 11 January 2012 15:03, T. Linden <tom@linden.at> wrote:
Hello Everyone,
first of all I'd like to thank the developers of Dancer so much. It's a great thing and I love it more from day to day!
While I'm new to Dancer, I'm not new to perl, but were using Django as app server for a long time now. Some day I thaught: this has to be done in perl, dammit - and I discovered Dancer.
However, I missed one thing, that is the forms module of Django. With forms you can validate user input, and generate forms. Since I didn't find anything near such a thing, I implemented it myself: Dancer::Forms.
It does the very same as the Django forms system does: you define some fields, how they shall be validated, feed your template with it, and that's it.
Beside user input validation I also added a CSRF protection feature to the module. This one could be better put into a Dancer plugin perhaps, I'm unsure...
The name maybe misleading, since Dancer::Forms does in fact not depend on Dancer. So it could be used in other environments as well. I hope it is ok, to put it into the Dancer:: namespace anyway.
There's still lots of things to do, like more unit tests, better debugging possibilities and - maybe - some kind of "model forms" sub module, which generates the forms from a dbic definition...
Take a look: https://metacpan.org/module/Dancer::Forms
best regards, Tom
-- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months. _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
On Wed, Jan 11, 2012 at 04:49:24PM +0200, sawyer x wrote:
However, along with Damien, I should note that we appreciate not putting modules under Dancer that aren't part of Dancer itself. We recommend the Dancer::Plugin::* namespace.
Ok, I'll rename it, no problem. - Tom -- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months.
On Wed, Jan 11, 2012 at 04:01:21PM +0100, T. Linden wrote:
Ok, I'll rename it, no problem.
So I now renamed it to HTML::FormsDj, the Dancer::Forms package is in the delete queue on pause. I'll put together a wrapper module for it (Dancer::Plugin::FormsDj or the like). Sorry again for the wrong naming. - Tom -- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months.
On Wed, Jan 11, 2012 at 5:24 PM, Thomas Linden <tom@linden.at> wrote:
On Wed, Jan 11, 2012 at 04:01:21PM +0100, T. Linden wrote:
Ok, I'll rename it, no problem.
So I now renamed it to HTML::FormsDj, the Dancer::Forms package is in the delete queue on pause. I'll put together a wrapper module for it (Dancer::Plugin::FormsDj or the like).
Sounds great! I'll be sure to mention this next time I give a talk about Dancer in front of Python programmers. :)
Sorry again for the wrong naming.
No worries. Thanks for contributing! :)
Ok, Dancer::Plugin::HTML::FormsDj is on pause as well. Using it looks like this: formsdj '/addbook' => { field => { title => { type => 'text', validate => { # some constraint }, required => 1, }, author => { type => 'text', validate => sub { # some constraint }, required => 1, }, }, name => 'registerform', csrf => 1, save => sub { return; }, template => 'addbook', redirect => '/booklist' }; That's all about it. best regards, Tom
Awesome, thanks for the reactivity ! On 11 January 2012 16:24, Thomas Linden <tom@linden.at> wrote:
On Wed, Jan 11, 2012 at 04:01:21PM +0100, T. Linden wrote:
Ok, I'll rename it, no problem.
So I now renamed it to HTML::FormsDj, the Dancer::Forms package is in the delete queue on pause. I'll put together a wrapper module for it (Dancer::Plugin::FormsDj or the like).
Sorry again for the wrong naming.
- Tom
-- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months. _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Le 11 janv. 2012 à 15:03, T. Linden a écrit :
However, I missed one thing, that is the forms module of Django. With forms you can validate user input, and generate forms. Since I didn't find anything near such a thing, I implemented it myself: Dancer::Forms.
Have you looked at HTML::FormFu? David Morel
On Wed, Jan 11, 2012 at 11:30:11PM +0100, David Morel wrote:
Have you looked at HTML::FormFu?
I didn't knew about it until someone here on the list mentioned it. But if I had found it previously, I'd decided not to use it anyway. It's just too large, complex (and bloated) with way too much dependencies. So it might by really powerfull but not my choice... - Tom -- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months.
Is there any other alternative to FormFu ? On 12 January 2012 11:55, Thomas Linden <tom@linden.at> wrote:
On Wed, Jan 11, 2012 at 11:30:11PM +0100, David Morel wrote:
Have you looked at HTML::FormFu?
I didn't knew about it until someone here on the list mentioned it. But if I had found it previously, I'd decided not to use it anyway. It's just too large, complex (and bloated) with way too much dependencies. So it might by really powerfull but not my choice...
- Tom
-- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months. _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
http://search.cpan.org/~nwiger/CGI-FormBuilder/ FormFu was developed as an effort to overcome FormBuilder's shortcomings IIRC (unverified). It probably has less dependencies :) There could be others, but last time I checked, these were the 2 main ones. David Le 12 janv. 2012 à 13:05, damien krotkine a écrit :
Is there any other alternative to FormFu ?
On 12 January 2012 11:55, Thomas Linden <tom@linden.at> wrote:
On Wed, Jan 11, 2012 at 11:30:11PM +0100, David Morel wrote:
Have you looked at HTML::FormFu?
I didn't knew about it until someone here on the list mentioned it. But if I had found it previously, I'd decided not to use it anyway. It's just too large, complex (and bloated) with way too much dependencies. So it might by really powerfull but not my choice...
- Tom
-- Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months. _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
David Morel
2012/1/12 damien krotkine <dkrotkine@gmail.com>:
Is there any other alternative to FormFu ?
There is rescent thread in PerlMonks too: http://www.perlmonks.org/?node_id=928619 But i am not found formbuilder which allows create more complex forms for DB tables which are related through many-to-many bridge. Data validating and automatic buildig of forms are good possibilities, but in my experience i tend to need forms which are related to many tables at once. Which tools to use in such cases? -- Wbr, Kõike hääd, Gunnar
https://metacpan.org/module/HTML::FormHandler is another popular one.. On Thu, Jan 12, 2012 at 10:36 PM, WK <wanradt@gmail.com> wrote:
2012/1/12 damien krotkine <dkrotkine@gmail.com>:
Is there any other alternative to FormFu ?
There is rescent thread in PerlMonks too: http://www.perlmonks.org/?node_id=928619
But i am not found formbuilder which allows create more complex forms for DB tables which are related through many-to-many bridge. Data validating and automatic buildig of forms are good possibilities, but in my experience i tend to need forms which are related to many tables at once. Which tools to use in such cases?
--
Wbr, Kõike hääd,
Gunnar _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
formhandler seems very powerful On 12 January 2012 14:59, Jason Galea <jason@lecstor.com> wrote:
https://metacpan.org/module/HTML::FormHandler
is another popular one..
On Thu, Jan 12, 2012 at 10:36 PM, WK <wanradt@gmail.com> wrote:
2012/1/12 damien krotkine <dkrotkine@gmail.com>:
Is there any other alternative to FormFu ?
There is rescent thread in PerlMonks too: http://www.perlmonks.org/?node_id=928619
But i am not found formbuilder which allows create more complex forms for DB tables which are related through many-to-many bridge. Data validating and automatic buildig of forms are good possibilities, but in my experience i tend to need forms which are related to many tables at once. Which tools to use in such cases?
--
Wbr, Kõike hääd,
Gunnar _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
_______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
participants (7)
-
damien krotkine -
David Morel -
Jason Galea -
sawyer x -
T. Linden -
Thomas Linden -
WK