Re: how to handle sqlalchemy exception with pyramid?

2011-08-05 Thread Michael Merickel
The real exceptions occur when the data is flushed to the database, not the actual commit. If you do a dbsession.flush() in your view code and it doesn't error then you can be fairly certain that the transaction's commit() will not fail. -- Michael -- You received this message because you ar

Re: When to use the transaction management

2011-08-05 Thread Bobby
I am still getting to know pyramid, so thank you very much for the clarification. On Aug 4, 1:34 am, Mike Orr wrote: > On Wed, Aug 3, 2011 at 2:49 PM, Bobby wrote: > > Just wondering in what scenarios, one would use the transaction > > management package, pyramid_tm. I understand transactions

Re: Remove Sequence button missing in Deform form

2011-08-05 Thread Chris McDonough
On Fri, 2011-08-05 at 11:13 -0700, Paul Gulley wrote: > Hi, I'm working in Pyramid and have been trying to get a sequenced > text input working, however the remove field button is fairling to > render. I've found an error that raises whenever a new sequence is > added, but can't trace it back: the

Remove Sequence button missing in Deform form

2011-08-05 Thread Paul Gulley
Hi, I'm working in Pyramid and have been trying to get a sequenced text input working, however the remove field button is fairling to render. I've found an error that raises whenever a new sequence is added, but can't trace it back: the line never occurs in any of my code, certainly not where speci

Re: Deform: determine current locale used by i18n in widget template?

2011-08-05 Thread Robert Forkel
Hi, Setting the locale for the datepick is only the first Part. You will also have to back the field with a date type that can handle dates in non-iso formats. I ended up with a custom type and a custom template. If you are interested, i can send you the code on monday. Regards, Robert Am 05.08.20

Re : how to handle sqlalchemy exception with pyramid?

2011-08-05 Thread Di Dio Adrien
Sorry my first message was incomplete (accidental sending): I solved my problem with the use of a finished callback: def commit_callback(request): '''commit or abort the transaction associated with request''' if request.exception is not None: transaction.abort() else:

Re: Deform: determine current locale used by i18n in widget template?

2011-08-05 Thread Chris McDonough
On Fri, 2011-08-05 at 16:59 +0200, Keesjan van Bunningen wrote: > I already spotted that one, Chris. > > Problem is I don't have access to the current request within the context of > a widget template ?! > > The only entities I have access to are 'field' and 'cstruct'. Something like this (unte

Re: Deform: determine current locale used by i18n in widget template?

2011-08-05 Thread Keesjan van Bunningen
I already spotted that one, Chris. Problem is I don't have access to the current request within the context of a widget template ?! The only entities I have access to are 'field' and 'cstruct'. Or am I missing something?! K -Oorspronkelijk bericht- From: Chris McDonough Sent: Frid

Re: Deform: determine current locale used by i18n in widget template?

2011-08-05 Thread Chris McDonough
On Fri, 2011-08-05 at 07:49 -0700, keesjan wrote: > Is there a way to determine the current locale used (by Pyramid) > inside a Deform widget template? > > What I'm trying to accomplish is to enable i18n/L10n support by the > JQuery datepicker. In order to do this I need to pass the language > ins

Deform: determine current locale used by i18n in widget template?

2011-08-05 Thread keesjan
Is there a way to determine the current locale used (by Pyramid) inside a Deform widget template? What I'm trying to accomplish is to enable i18n/L10n support by the JQuery datepicker. In order to do this I need to pass the language inside a javascript snippet, like so: $.datepick.regional['fr']

how to handle sqlalchemy exception with pyramid?

2011-08-05 Thread Di Dio Adrien
I use the pyramid_routesalchemy scaffold, Is it possible to handle an sqlalchemy excpetion in a view. If I understand, the transaction is commited after the request . def trackMail(request): try: dbsession = DBSession() test=Test("test") dbsession.add(test)

Re: Pyramid: choose renderer at runtime

2011-08-05 Thread neurino
Thanks Michael, thanks Carsten, that's just what I was looking for. neurino On Aug 4, 7:46 pm, Carsten Senger wrote: > --On Donnerstag, August 04, 2011 06:57:15 -0700 > > neurino wrote: > > [...] > > > > > > > > > > > In a Pylons controller I could select which renderer use like this: > > > de