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
-~----------~----~----~----~------~----~------~--~---