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,
> password_confirm=None,
>              **kw):
>         try:
>             u = User(user_name=name, display_name=name, email=email,
> password=password)
>             raise redirect("/registered")
>
>         except SQLError:
>             flash("That account already exists.")

i think youre confusing a pattern from SQLObject here.  creating a  
new object doesnt write any changes to the database in sqlalchemy.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to