Doesn't work in 0.3: http://0.0.0.0:8080/ ^[[1;5CTraceback (most recent call last): File "/home/bjorn/projects/om-svn/web/application.py", line 205, in wsgi result = self.handle_with_processors() File "/home/bjorn/projects/om-svn/web/application.py", line 177, in handle_with_processors return process(self.processors) File "/home/bjorn/projects/om-svn/web/application.py", line 172, in process return p(lambda: process(processors)) File "/home/bjorn/projects/om-svn/web/session.py", line 58, in _processor return handler() File "/home/bjorn/projects/om-svn/web/application.py", line 172, in <lambda> return p(lambda: process(processors)) File "/home/bjorn/projects/om-svn/web/application.py", line 174, in process return self.handle() File "/home/bjorn/projects/om-svn/web/application.py", line 166, in handle return self._delegate(fn, self.fvars, args) File "/home/bjorn/projects/om-svn/web/application.py", line 342, in _delegate return handle_class(cls) File "/home/bjorn/projects/om-svn/web/application.py", line 317, in handle_class return tocall(*args) File "/home/bjorn/projects/om-svn/app.py", line 9, in POST return self.handle_request("POST", path) File "/home/bjorn/projects/om-svn/app.py", line 29, in handle_request return request_site.response() File "/home/bjorn/projects/om-svn/pages/equip_ogre.py", line 61, in response c.create_config(v.get_vars()) File "/home/bjorn/projects/om-svn/configuration.py", line 49, in create_config web.transact() AttributeError: 'module' object has no attribute 'transact'
> -------- Original Message -------- > Subject: [webpy] Re: transactions in webpy + postgres > From: Juan Pablo Scaletti <[EMAIL PROTECTED]> > Date: Tue, April 29, 2008 2:43 pm > To: "web.py" <[email protected]> > > > Adapted from: > http://postgresql.com.cn/docs/8.3/static/tutorial-transactions.html > > web.transact() > try: > bd.update('account', balance = 'balance - 100.00', > where='name = $name', vars = {'name': 'Alice'}) > > bd.update('account', balance = 'balance + 100.00', > where='name = $name', vars = {'name': 'Bob'}) > > web.commit() > except: > web.rollback() > raise() > > You want to be sure that either all these updates happen, or none of > them happen. It would certainly not do for a system failure to result > in Bob receiving $100.00 that was not debited from Alice. Nor would > Alice long remain a happy customer if she was debited without Bob > being credited. > > On 29 abr, 11:18, Paul Jobs <[EMAIL PROTECTED]> wrote: > > guys > > can you share a simple example to use web.transact and web.rollback thanks > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" 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/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
