Re: Pyramid transactions and other request lifecycle events

2011-08-04 Thread Matt Feifarek
On Thu, Aug 4, 2011 at 1:37 PM, Chris McDonough wrote: > when using transactions, how all-in does > > one have to go? > > I guess in a sense the answer is "none" and "a lot" at the same time. > > The transaction machinery provides a hook to do something based on the > commit status. If the trans

Re: Pyramid transactions and other request lifecycle events

2011-08-04 Thread Chris McDonough
On Thu, 2011-08-04 at 13:03 -0500, Matt Feifarek wrote: > On Thu, Aug 4, 2011 at 12:06 PM, Chris McDonough > wrote: > > I kinda feel like there is still a larger question here, > though... > > using transaction manager, code that is executed in a view > callable >

Re: Pyramid: choose renderer at runtime

2011-08-04 Thread Carsten Senger
--On Donnerstag, August 04, 2011 06:57:15 -0700 neurino wrote: [...] In a Pylons controller I could select which renderer use like this: def my_view(self): c.form = Form(request, BasicSchema) if c.form.validate(): obj = form.bind(MYModel()) if **need more info**:

Re: deform: Support for readonly on individual form fields?

2011-08-04 Thread Rapier Bsd
You can do something like: Assuming you have two schema nodes in your schema: foo and bar, you can have a readonly foo like this: schema = Schema() form = Form(schema) form.set_widgets({'foo':widget.TextInputWidget(template='readonly/ textinput')}) -- You received this message because you are su

Re: Pyramid transactions and other request lifecycle events

2011-08-04 Thread Matt Feifarek
On Thu, Aug 4, 2011 at 12:06 PM, Chris McDonough wrote: > > I kinda feel like there is still a larger question here, though... > > using transaction manager, code that is executed in a view callable > > doesn't *really* finish till after the users' function is over... so > > there's no chance of

Re: Pyramid transactions and other request lifecycle events

2011-08-04 Thread Mike Orr
On Thu, Aug 4, 2011 at 9:15 AM, Matt Feifarek wrote: > On Thu, Aug 4, 2011 at 12:44 AM, Mike Orr wrote: >> >> The transaction should fail when the update query is run, not when it >> commits. So you shouldn't set the 'authenticated' flag until the query >> finishes without error. > > Good advice,

Re: Switching to declarative configuration breaks paster

2011-08-04 Thread Mike Orr
On Thu, Aug 4, 2011 at 6:27 AM, Benjamin Sims wrote: > Hi, > I am switching my application from imperative to declarative configuration > using view_config. > However, when I add config.scan() to __init.py__, my application refuses to > start. If I do: > 'paster serve config.ini ', I get a message

Re: Pyramid transactions and other request lifecycle events

2011-08-04 Thread Chris McDonough
On Thu, 2011-08-04 at 11:15 -0500, Matt Feifarek wrote: > On Thu, Aug 4, 2011 at 12:44 AM, Mike Orr > wrote: > The transaction should fail when the update query is run, not > when it > commits. So you shouldn't set the 'authenticated' flag until > the query >

Re: Pyramid transactions and other request lifecycle events

2011-08-04 Thread Matt Feifarek
On Thu, Aug 4, 2011 at 12:44 AM, Mike Orr wrote: > The transaction should fail when the update query is run, not when it > commits. So you shouldn't set the 'authenticated' flag until the query > finishes without error. > Good advice, but not possible in this case; I'm using ZODB... the "query"

Re: Pyramid: choose renderer at runtime

2011-08-04 Thread Michael Merickel
This may help you: http://stackoverflow.com/questions/6553569/in-pyramid-how-can-i-use-a-different-renderer-based-on-contents-of-context/6557728#6557728 On top of that, pyramid also supports: request.override_renderer = ... via http://docs.pylonsproject.org/projects/pyramid/1.1/narr/renderers.

Pyramid: choose renderer at runtime

2011-08-04 Thread neurino
Is there a *suggested* way to set a view renderer at runtime in Pyramid? What I need is to render, in the same view, a basic form then, if some more info are needed (this is known by first form data), render another form with already entered info as hidden field and more fields to be filled. In a

Switching to declarative configuration breaks paster

2011-08-04 Thread Benjamin Sims
Hi, I am switching my application from imperative to declarative configuration using view_config. However, when I add config.scan() to __init.py__, my application refuses to start. If I do: 'paster serve config.ini ', I get a message saying 'no such option --reload'. If I just do 'paster serve