[sqlalchemy] Re: sqlalchemy exceptions

2007-05-08 Thread Michael Bayer
On May 8, 2007, at 1:23 PM, noah.gift wrote: I am trying to use the following code to handle an exception in Turbogears, but it does not grab the SQLError: please note I did a: from sqlalchemy.exceptions import SQLError def save(self, name=None, email=None, password=None,

[sqlalchemy] Re: sqlalchemy exceptions

2007-05-08 Thread noah.gift
On May 8, 1:58 pm, Michael Bayer [EMAIL PROTECTED] wrote: On May 8, 2007, at 1:23 PM, noah.gift wrote: I am trying to use the following code to handle an exception in Turbogears, but it does not grab the SQLError: please note I did a: from sqlalchemy.exceptions import SQLError

[sqlalchemy] Re: sqlalchemy exceptions

2007-05-08 Thread shday
Forgive the dumb question, but what is the proper SQLAlchemy recommended way to deal with a situation like this. Should I see if the object already exists first, or be lazy and try to write to the database and attempt to catch the exception. Good question. Personally I think that this

[sqlalchemy] Re: sqlalchemy exceptions

2007-05-08 Thread Michael Bayer
On May 8, 2007, at 5:45 PM, noah.gift wrote: On May 8, 1:58 pm, Michael Bayer [EMAIL PROTECTED] wrote: On May 8, 2007, at 1:23 PM, noah.gift wrote: I am trying to use the following code to handle an exception in Turbogears, but it does not grab the SQLError: please note I did a: