In sort I'll test it. <off> I'm somewhat lost in plugin threads :( Is the plugin system stable now? Are there any complete documentation about it in current state? </off>
On márc. 26, 03:04, mdipierro <mdipie...@cs.depaul.edu> wrote: > No... that did not work. This does: > > http://web2py.com/plugins/default/locking > > On Mar 25, 5:20 pm, Massimo Di Pierro <mdipie...@cs.depaul.edu> wrote: > > > > > Give this a try... it may need some debugging > > > 1) install the plugin: > > > 2) in the controller actions that need some locking > > > lock=plugin_locking('tablename',record_id) > > if not lock: > > # record was locked > > redirect(....) > > else: > > # lock acquired > > return dict(...,lock=lock) > > > 3) and in page view: > > > {{=lock}} > > > will insert the JS that will renew the lock as long as the page is open > > > The lock will be associated to the record_id of tablename and any > > other user trying to access any other page locking the same record > > will be unable to do so. > > > As a shortcut you can simply insert > > > {{=plugin_locking('tablename',record_id) or 'this record was > > locked by another user'}} > > > or > > > {{=plugin_locking('tablename',record_id) or redirect('somehwre')}} > > > Massimo > > > web2py.plugin.locking.w2p > > 1KViewDownload -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.