You know it if it's not failing ;) but I understand the desire to know beforehand - all you need to do is a dbsession.flush(). If that's failing, you get an excpetion.

Unfortunately, that means the ongoing transaction is borked. That's a sqlalchemy design thing. So the safe way to deal with these things is the common check-lock-check-create-dance to make sure the transaction commits.

Diez

Am 03.07.2010 um 12:49 schrieb Andrea Crotti <andrea.crotti. [email protected]>:

Mm I deleted the database, executed setup-app again and tried another
time and it works fine...
Now it's fine, but I don't see the flash


   @validate(create_person_form, error_handler=new_person)
   @expose()
   def create_person(self, **kw):
       """ create a new entry, store it into the DB and exit """
         # FIXME: the form values are in italian now!!
       person = Person(name=kw[u'name']) # pass directly the
dictionary with the values inserted
       # how do we know here?
       flash(l_("Record created correctly"))
       redirect("/")

if I just add it creating it, how do I know that the transaction was
successful?

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


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

Reply via email to