Re: @validate revisited, JSON support, content negotiation

2010-02-27 Thread Jonathan Vanasco
ah, interesting -- so the validation becomes a function of the controller. i'd like to make a suggestion to your then. i have an arg to validate called gatekeeper , which is enabled as True by default ( along with post_only ) In conjunction with one another, gatekeeper just makes sure that if you

Re: setup/teardown in pylons tests?

2010-02-27 Thread iain duncan
On Feb 27, 3:48 pm, Marius Gedminas wrote: > On Sat, Feb 27, 2010 at 01:47:41PM -0800, iain duncan wrote: > > What I have done is add a method called setup to the same > > TestControllers that get made when you make a controller. In a normal > > nose test class, this gets run prior to each test,

Re: setup/teardown in pylons tests?

2010-02-27 Thread Marius Gedminas
On Sat, Feb 27, 2010 at 01:47:41PM -0800, iain duncan wrote: > What I have done is add a method called setup to the same > TestControllers that get made when you make a controller. In a normal > nose test class, this gets run prior to each test, in this case it > doesn't ever get run. Python is ca

Re: setup/teardown in pylons tests?

2010-02-27 Thread iain duncan
On Feb 27, 4:53 am, Marius Gedminas wrote: > On Fri, Feb 26, 2010 at 12:26:59PM -0800, iain duncan wrote: > > Hi folks, I'm wondering why when using nose to runs pylons > > paste.fixture based test classes, setup/teardown don't seem to run > > ( maybe I'm missing something?) > > It's hard to say,

Re: annoying htmlfill error - on error, overwrites all submit buttons with the selected option from formencode/validate

2010-02-27 Thread Ian Wilson
Seems like a work around would be to just give the fields different names right? If they are named do_this and do_that then they either have a value or they do not. Another solution would be to only fill the fields and not the submit buttons, that isn't always possible though depending on your lay

Re: Best way to write command line / batch tools?

2010-02-27 Thread Mike Orr
On Sat, Feb 27, 2010 at 6:47 AM, Mike Burrows wrote: > I should add that we have tried both separate scripts and paster entry > points and now prefer the latter for anything that's not just a one- > off task. Interesting that people like creating entry points. I hate them. You have to make an ent

annoying htmlfill error - on error, overwrites all submit buttons with the selected option from formencode/validate

2010-02-27 Thread Jonathan Vanasco
this is annoying. lets say that you have mutiple submit buttons: input type="submit" name="action" value="do_this" input type="submit" name="action" value="do_that" if formencode/validate catches an error on the form, all "action" will become the clicked value. htmlfill.render should ignore

Re: Best way to write command line / batch tools?

2010-02-27 Thread Mike Burrows
I should add that we have tried both separate scripts and paster entry points and now prefer the latter for anything that's not just a one- off task. An interesting example is schema migration - I will review our code and see whether it would make a good example to publish as a recipe. Mike Burro

Re: setup/teardown in pylons tests?

2010-02-27 Thread Marius Gedminas
On Fri, Feb 26, 2010 at 12:26:59PM -0800, iain duncan wrote: > Hi folks, I'm wondering why when using nose to runs pylons > paste.fixture based test classes, setup/teardown don't seem to run > ( maybe I'm missing something?) It's hard to say, since you provided almost no information (e.g. the erro

Re: Best way to write command line / batch tools?

2010-02-27 Thread Mike Burrows
We do this quite a lot. We're also beginning to treat our app's JSON interface as a scripting interface (in fact that was one motivation for adding it). That allows you do script tasks that involve more than one environment, such as migrating objects from one environment to another. My PathTo/D