This code is the select function from CRUD...

this code that you put here is to get the variable... ok... I know that...
What I want to know is how to set the linkto parameter on /data/select since
it get's it from **attr parameter:

*    def select(*
        self,
        table,
        query=None,
        fields=None,
        orderby=None,
        limitby=None,
        headers={},
*        **attr*
        ):
        request = self.environment.request
        if not (isinstance(table, self.db.Table) or table in
self.db.tables):
            raise HTTP(404)
        if not isinstance(table, self.db.Table):
            table = self.db[table]
        if not query:
            query = table.id > 0
        if not fields:
            fields = [table.ALL]
        rows = self.db(query).select(*fields, **dict(orderby=orderby,
            limitby=limitby))
        if not rows:
            return None # Nicer than an empty table.
*        if not 'linkto' in attr:
            attr['linkto'] = self.url(args='read')*
        if not 'upload' in attr:
            attr['upload'] = self.url('download')
        if request.extension != 'html':
            return rows.as_list()
        return SQLTABLE(rows, headers=headers, **attr)

So I'd like to set this linkto parameter on /data/select URL and change it
to update instead of read.

Regards,

Tito


On Thu, Jul 30, 2009 at 3:20 PM, Fran <francisb...@googlemail.com> wrote:

>
> On Jul 30, 7:17 pm, Tito Garrido <titogarr...@gmail.com> wrote:
> > On the select code there is a attr parameter...
> > How can I set it though GET variables?
>
> Parse in your controller:
>
> def myselect():
>    linkto = request.vars['linkto']
>    db(query).select(linkto=linkto)
>
> F
> >
>


-- 

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______
Sent from Campinas, SP, Brazil

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to