I noticed that t2.logout() could use onlogout=None..
def logout(self,next='index',onlogout=None):
"""
To use, create a controller:
def logout(): t2.logout(next='index')
"""
request,response,session,cache,T,db=self._globals()
session.t2.person_id=None
session.t2.person_name=None
session.t2.person_email=None
session.t2.my_groups_id=None
if onlogout:
onlogout()
if next:
session.flash=self.messages.logged_out
self.redirect(next)
The whole next='action' does not allow for extra args or vars. I wish
next= just accepted a string that was the target url, so you can
construct a real url with args and vars and pass it to next. Since
next= is so strict, I am using onlogout to redirect the next url.
Robin
On Jan 8, 7:05 pm, mdipierro <[email protected]> wrote:
> yes. please email me the patch.
>
> On Jan 8, 6:32 pm, Robin B <[email protected]> wrote:
>
> > t2.update takes a query parameter which is nice, but if you already
> > have a reference to record you want to edit, then there is no need to
> > query for it again.
>
> > What about adding a record=None option just like SQLFORM that is
> > compared to None before the query is attempted?
>
> > # in t2.py
> > def update
> > (self,table,record=None,query=None,next=None,deletable=True,
> > vars={},onaccept=None,ondelete=None):
> > ...
> > if record is not None:
> > rows = [record]
> > elif query:
> > rows=table._db(query).select(table.ALL,limitby=(0,1))
> > else:
> > id=self.id or self._error()
> > rows=table._db(table.id==id).select(table.ALL,limitby=
> > (0,1))
>
> > Robin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---