I also thought so but here is what happens:

File "/Users/vasilina/Documents/Development/ADVANTAGE/web2py/
applications/advantage/controllers/radar.py", line 37, in data_storage
    time_based_details = db(db.time_based.PIN==record.PIN).select
(_orderby=db.time_based.ca_date, *full_qualifiers)
  File "/Users/vasilina/Documents/Development/ADVANTAGE/web2py/gluon/
sql.py", line 1132, in select
    query=self._select(*fields,**attributes)
  File "/Users/vasilina/Documents/Development/ADVANTAGE/web2py/gluon/
sql.py", line 1067, in _select
    raise SyntaxError, 'invalid select attribute'
SyntaxError: invalid select attribute

It takes fields for selection only if they are * at first position.

On Nov 30, 7:29 pm, mdipierro <[EMAIL PROTECTED]> wrote:
> * and ** parameters have to be last:
>
> time_based_details = db().select
> (_orderby=db.time_based.ca_date,*full_qualifiers)
>
> On Nov 30, 4:04 am, SergeyPo <[EMAIL PROTECTED]> wrote:
>
> > Hello!
>
> > This is probably Python question, but maybe you can help:
> > I need to prepare the list of fields to be selected from DB
> > programmatically:
>
> > full_qualifiers = []   #list of SQLTABLE fields
> > time_based_details = db().select(*full_qualifiers,
> > _orderby=db.time_based.ca_date)
>
> > But Python does not allow me to use both * and named parameter in one
> > function call. This works:
>
> > time_based_details = db().select(*full_qualifiers)
>
> > but I need to sort data according to date.
>
> > Thank you in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
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