Re: [pylons-discuss] Independent data model validation with colander

2016-06-08 Thread tonthon
Hi, you may use peppercorn for this purpose : import peppercorn controls = request.params.items() values = peppercorn.parse(controls) try: appstruct =

[pylons-discuss] Independent data model validation with colander

2016-06-08 Thread Andrius Kulbis
I started using colander in my pyramid project. Created a simple data model mapping using colander class DataModel(colander.MappingSchema): user_count = colander.SchemaNode(colander.Integer()) expiration_date = colander.SchemaNode(colander.Date()) comment =

Re: Model validation

2011-12-27 Thread Gael Pasgrimaud
FYI I've released pyramid_formalchemy 0.4.3 [1] It's now pyramid 1.3+ compatible and the pyramid_fa scaffold is also up to date. For now I've added zope.component as a dependencie (pyramid removed it because of the py3 compat I guess) [1] http://docs.formalchemy.org/pyramid_formalchemy/ On

Re: Model validation

2011-12-19 Thread Gael Pasgrimaud
On Mon, Dec 19, 2011 at 5:35 AM, rihad ri...@mail.ru wrote: On Dec 18, 12:52 am, Gael Pasgrimaud g...@gawel.org wrote: On Sat, Dec 17, 2011 at 9:41 PM, rihad ri...@mail.ru wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? No, you don't really need a template. You can

Re: Model validation

2011-12-18 Thread rihad
On Dec 18, 12:52 am, Gael Pasgrimaud g...@gawel.org wrote: On Sat, Dec 17, 2011 at 9:41 PM, rihad ri...@mail.ru wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? No, you don't really need a template. You can add pyramid_formalchemy to a project with only a few extra

Re: Model validation

2011-12-18 Thread Gael Pasgrimaud
On Sun, Dec 18, 2011 at 10:04 AM, rihad ri...@mail.ru wrote: On Dec 18, 12:52 am, Gael Pasgrimaud g...@gawel.org wrote: On Sat, Dec 17, 2011 at 9:41 PM, rihad ri...@mail.ru wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? No, you don't really need a template. You

Re: Model validation

2011-12-18 Thread rihad
On Dec 18, 12:52 am, Gael Pasgrimaud g...@gawel.org wrote: On Sat, Dec 17, 2011 at 9:41 PM, rihad ri...@mail.ru wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? No, you don't really need a template. You can add pyramid_formalchemy to a project with only a few extra

Re: Model validation

2011-12-18 Thread rihad
$ pserve --reload development.ini ... File /usr/home/rihad/pyramid/sol/env/lib/python2.7/site-packages/pyramid_formalchemy-0.4.2-py2.7.egg/pyramid_formalchemy/views.py, line 2, in module import zope.component.event ImportError: No module named component.event -- You received this

Re: Model validation

2011-12-17 Thread rihad
Hi, folks. I'm trying to follow this guide: http://docs.formalchemy.org/pyramid_formalchemy/ to install pyramid_formalchemy for pyramid-1.3a2-py2.7. I've easy_installed pyramid_formalchemy with its dependencies, added 'pyramid_formalchemy', 'fa.jquery', to requires in setup.py and rerun

Re: Model validation

2011-12-17 Thread Chris McDonough
On Sat, 2011-12-17 at 12:19 -0800, rihad wrote: Hi, folks. I'm trying to follow this guide: http://docs.formalchemy.org/pyramid_formalchemy/ to install pyramid_formalchemy for pyramid-1.3a2-py2.7. I've easy_installed pyramid_formalchemy with its dependencies, added 'pyramid_formalchemy',

Re: Model validation

2011-12-17 Thread rihad
Thanks, but... after doing what you suggested all looks great at first: $ paster create --list-templates Available templates: basic_package: A basic setuptools-enabled package paste_deploy: A web application deployed through paste.deploy pylons_fa: Pylons application template with

Re: Model validation

2011-12-17 Thread rihad
Is going back to 1.2 the only way to try pyramid_formalchemy out? -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send email to

Re: Model validation

2011-12-17 Thread Gael Pasgrimaud
On Sat, Dec 17, 2011 at 9:41 PM, rihad ri...@mail.ru wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? No, you don't really need a template. You can add pyramid_formalchemy to a project with only a few extra lines to your __init__.py:

Re: Model validation

2011-12-17 Thread Chris McDonough
On Sat, 2011-12-17 at 12:41 -0800, rihad wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? That'd be the easiest way, at least until pyramid_formalchemy is updated to work with Pyramid 1.3. - C -- You received this message because you are subscribed to the Google

Re: Model validation

2011-12-17 Thread Chris McDonough
On Sat, 2011-12-17 at 16:05 -0500, Chris McDonough wrote: On Sat, 2011-12-17 at 12:41 -0800, rihad wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? That'd be the easiest way, at least until pyramid_formalchemy is updated to work with Pyramid 1.3. For the record, how

Re: Model validation

2011-12-17 Thread Gael Pasgrimaud
On Sat, Dec 17, 2011 at 10:09 PM, Chris McDonough chr...@plope.com wrote: On Sat, 2011-12-17 at 16:05 -0500, Chris McDonough wrote: On Sat, 2011-12-17 at 12:41 -0800, rihad wrote: Is going back to 1.2 the only way to try pyramid_formalchemy out? That'd be the easiest way, at least until

Re: Model validation

2011-12-17 Thread Jonathan Vanasco
I've built dozens of sites over the past 14 or so years , with Ad Agencies, Large Brands, Tech Startups, Major Media companies. Doing this, I've learned that Frameworks are really really great for the run-of-the-mill project that has a quick deadline, doesn't do anything new exciting, and has a

Re: Model validation

2011-12-14 Thread rihad
Hi, Chris. Since Deform doesn't mention CSRF, I assume it must be done by another session-based plugin at the discretion of the developer? Like, opt-in security? :) Also, the docs say that some form controls rely on JS being available. That's understandable, like in the case of date-time controls.

Re: Model validation

2011-12-14 Thread rihad
Thanks for the tip and sorry, I didn't mean to offend anybody. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send email to

Re: Model validation

2011-12-14 Thread rihad
Doesn't Deform fill in the form with the values submitted when a validation error occurs? -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send

Re: Model validation

2011-12-14 Thread Chris McDonough
On Wed, 2011-12-14 at 07:19 -0800, rihad wrote: Doesn't Deform fill in the form with the values submitted when a validation error occurs? Can you describe what's unclear about http://docs.pylonsproject.org/projects/deform/en/latest/basics.html#validating-a-form-submission - C -- You

Re: Model validation

2011-12-14 Thread rihad
On Dec 14, 11:34 pm, Chris McDonough chr...@plope.com wrote: On Wed, 2011-12-14 at 07:19 -0800, rihad wrote: Doesn't Deform fill in the form with the values submitted when a validation error occurs? Can you describe what's unclear

Re: Model validation

2011-12-13 Thread Chris McDonough
On Tue, 2011-12-13 at 01:59 -0800, rihad wrote: On Dec 13, 6:55 am, Mike Orr sluggos...@gmail.com wrote: Pyramid is a mid-level framework like Pylons. For a lightweight framework, see web.py, Aspen, Quixote, Flask, Werkzeug, or several others. Pyramid's focus is on being scalable, both

Re: Model validation

2011-12-13 Thread Daniel Nouri
On Tue, Dec 13, 2011 at 3:55 AM, Mike Orr sluggos...@gmail.com wrote: Ptah aims to offer the same kind of bells and whistles Django does. It's at an initial alpha release. It's the closest Pyramid has to a full-stack framework right now. Kotti is specifically a content-management system.

Re: Model validation

2011-12-13 Thread Michael Bayer
On Dec 13, 2011, at 6:09 AM, Chris McDonough wrote: On Tue, 2011-12-13 at 01:59 -0800, rihad wrote: You are presuming that there is a one true form library that does everything well that is completely satisfactory in all cases. I can tell you from pretty hard experience that this is not

Re: Model validation

2011-12-13 Thread Eric Rasmussen
I'd also like to add that Pyramid's level of abstraction (measured in brick size, if you will) is just right for many projects, making it easy to be productive and flexible at the same time. Those of us that are using Pyramid successfully went through a learning curve to be sure, but I haven't

Re: Model validation

2011-12-13 Thread Benjamin Sims
Michael, I wonder if you might give an idea of how you handle that? Do you manually put forms into templates and validate yourself, or do you still use a validation library but with custom templates. Just wondering as I have tried both before. Ben On 13 December 2011 15:48, Michael Bayer

Re: Model validation

2011-12-13 Thread Michael Bayer
I definitely use validation libs, currently we're still on FormEncode (colander or flatland will be next), but the rendering I do using Mako defs which can be customized and laid out at the template level which is a lot more WYSIWYG than using code generators. A full example of my approach is

Re: Model validation

2011-12-13 Thread Mike Orr
On Tue, Dec 13, 2011 at 1:59 AM, rihad ri...@mail.ru wrote: On Dec 13, 6:55 am, Mike Orr sluggos...@gmail.com wrote: Pyramid is a mid-level framework like Pylons. For a lightweight framework, see web.py, Aspen, Quixote, Flask, Werkzeug, or several others. Pyramid's focus is on being

Re: Model validation

2011-12-13 Thread rihad
On Dec 13, 11:45 pm, Mike Orr sluggos...@gmail.com wrote: If you have specific questions about which libraries to use on top of Pyramid, such as which form library to choose, describe what kind of form API or workflow you expect, and we can suggest something the most similar. Do you just want

Re: Model validation

2011-12-13 Thread Vlad K.
Which is in my view exactly the power of Pyramid. By combining libs that do one job and do it well (like in The UNIX Way), one can build an application with Pyramid which is far, far more advanced at given task(s) than any full-stack solution limited only to what its stack is mandating.

Re: Model validation

2011-12-13 Thread rihad
On Dec 14, 12:23 am, Vlad K. v...@haronmedia.com wrote: Which is in my view exactly the power of Pyramid. By combining libs that do one job and do it well (like in The UNIX Way), one can build an application with Pyramid which is far, far more advanced at given task(s) than any full-stack

Re: Model validation

2011-12-13 Thread Michael Merickel
On Tue, Dec 13, 2011 at 2:29 PM, rihad ri...@mail.ru wrote: I totally agree. But this comes at a cost: you have to be nearly just as proficient and experienced as its authors to appreciate its full power. Actually it just means you have to read the documentation to use it. You can't just sit

Re: Model validation

2011-12-13 Thread Mengu
rihad, i wonder if you have tried TurboGears 2 or not and if you had what pushed you away from it. what you are asking for pyramid are already available with TG. On 13 Aralık, 22:19, rihad ri...@mail.ru wrote: On Dec 13, 11:45 pm, Mike Orr sluggos...@gmail.com wrote: If you have specific

Re: Model validation

2011-12-13 Thread Danny Navarro
On Dec 13, 2011 8:45 PM, Mike Orr sluggos...@gmail.com wrote: On Tue, Dec 13, 2011 at 1:59 AM, rihad ri...@mail.ru wrote: On Dec 13, 6:55 am, Mike Orr sluggos...@gmail.com wrote: Pyramid is a mid-level framework like Pylons. For a lightweight framework, see web.py, Aspen, Quixote,

Re: Model validation

2011-12-13 Thread rihad
On Dec 14, 12:55 am, Michael Merickel mmeri...@gmail.com wrote: On Tue, Dec 13, 2011 at 2:29 PM, rihad ri...@mail.ru wrote: I totally agree. But this comes at a cost: you have to be nearly just as proficient and experienced as its authors to appreciate its full power. Actually it just

Re: Model validation

2011-12-13 Thread Chris McDonough
On Tue, 2011-12-13 at 21:51 -0800, rihad wrote: On Dec 14, 12:55 am, Michael Merickel mmeri...@gmail.com wrote: On Tue, Dec 13, 2011 at 2:29 PM, rihad ri...@mail.ru wrote: I totally agree. But this comes at a cost: you have to be nearly just as proficient and experienced as its authors to

Model validation

2011-12-12 Thread rihad
Hi, all. Does Pyramid (or Sqlalchemy) offer any kind of model validation? Like, min/max value/length a numerical/textual value may have. On the same note, how come there's no support for HTML forms? A form thing which would preferably grab fields from a model to avoid duplicating stuff. Or are we

Re: Model validation

2011-12-12 Thread Benjamin Sims
it personally. Ben On 12 December 2011 10:23, rihad ri...@mail.ru wrote: Hi, all. Does Pyramid (or Sqlalchemy) offer any kind of model validation? Like, min/max value/length a numerical/textual value may have. On the same note, how come there's no support for HTML forms? A form thing which would

Re: Model validation

2011-12-12 Thread Chris McDonough
On Mon, 2011-12-12 at 02:23 -0800, rihad wrote: Hi, all. Does Pyramid (or Sqlalchemy) offer any kind of model validation? Like, min/max value/length a numerical/textual value may have. I use Colander for this: http://docs.pylonsproject.org/projects/colander/en/latest/ Folks also use

Re: Model validation

2011-12-12 Thread Chris Rossi
On Mon, Dec 12, 2011 at 7:11 AM, Chris McDonough chr...@plope.com wrote: On Mon, 2011-12-12 at 02:23 -0800, rihad wrote: Hi, all. Does Pyramid (or Sqlalchemy) offer any kind of model validation? Like, min/max value/length a numerical/textual value may have. I use Colander for this: http

Re: Model validation

2011-12-12 Thread rihad
Great thanks to everyone for the tips. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send email to

Re: Model validation

2011-12-12 Thread rihad
Pfff... I've got a confession to make :) All this lightweightedness makes using Pyramid a bit confusing at first. It's like needing to get separate Firefox plugins to enable JavaScript, show JPEGs, browse FTP sites, handle form submission, etc. Dare I say, I find full-stack frameworks like TG2

Re: Model validation

2011-12-12 Thread Alan Runyan
On Mon, Dec 12, 2011 at 10:51 AM, rihad ri...@mail.ru wrote: Pfff... I've got a confession to make :) All this lightweightedness makes using Pyramid a bit confusing at first. It's like needing to get separate Firefox plugins to enable JavaScript, show JPEGs, browse FTP sites, handle form

Re: Model validation

2011-12-12 Thread Chris McDonough
On Mon, 2011-12-12 at 08:51 -0800, rihad wrote: Pfff... I've got a confession to make :) All this lightweightedness makes using Pyramid a bit confusing at first. It's like needing to get separate Firefox plugins to enable JavaScript, show JPEGs, browse FTP sites, handle form submission, etc.

Re: Model validation

2011-12-12 Thread Thomas G. Willis
H, and yet my company is using pyramid quite successfully where 2 full stack frameworks have failed us. Clearly something is wrong. :) Thomas G. Willis On Mon, Dec 12, 2011 at 11:51 AM, rihad ri...@mail.ru wrote: Pfff... I've got a confession to make :) All this lightweightedness

Re: Model validation

2011-12-12 Thread Vlad K.
No they're not the same. I'm developing a complex app based on Pyramid and I love the fact that Pyramid is lightweight and not assuming things. It allows me to: 1. choose peppercorn + colander to validate multilevel forms (forms that are not flat key-value pairs but complex hierarchies),

Re: Model validation

2011-12-12 Thread Michael Bayer
On Dec 12, 2011, at 2:40 PM, Chris McDonough wrote: I've seen two people add code to the same package that does the same thing because nobody really knows how it works anymore. This reads like the argument people make for off-the-shelf/out-of-the-box, rather than against it. Unless you

Re: Model validation

2011-12-12 Thread Chris McDonough
On Mon, 2011-12-12 at 18:49 -0500, Michael Bayer wrote: On Dec 12, 2011, at 2:40 PM, Chris McDonough wrote: I've seen two people add code to the same package that does the same thing because nobody really knows how it works anymore. This reads like the argument people make for

Re: Model validation

2011-12-12 Thread Mike Orr
On Mon, Dec 12, 2011 at 8:51 AM, rihad ri...@mail.ru wrote: Pfff... I've got a confession to make :) All this lightweightedness makes using Pyramid a bit confusing at first. It's like needing to get separate Firefox plugins to enable JavaScript, show JPEGs, browse FTP sites, handle form