It requires exposing an ajax listener. It would introduce a dependency
on a js library and would be more complex for the user who would have
to implement the listener.

Massimo

On Mar 26, 9:20 am, szimszon <[email protected]> wrote:
> Seems to work. Thank you!
>
> Anyway I think in long term it would be better to have such feature
> integrated in core web2py.
>
> On márc. 26, 03:04, mdipierro <[email protected]> wrote:
>
> > No... that  did not work. This does:
>
> >http://web2py.com/plugins/default/locking
>
> > On Mar 25, 5:20 pm, Massimo Di Pierro <[email protected]> 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 notlock:
> > >     # record was locked
> > >     redirect(....)
> > > else:
> > >     #lockacquired
> > >     return dict(...,lock=lock)
>
> > > 3) and in page view:
>
> > >     {{=lock}}
>
> > > will insert the JS that will renew thelockas long as the page is open
>
> > > Thelockwill 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to