The fact is it should re redundant and more complex to use than the
current solution.

Currently you can select the fields returned by the select before
passing it to SQLTABLE

rows=db(...).select(field1, field2)
table=SQLTABLE(rows) # or table=rows works the same
return dict(table=table)

In this way you do not pull from db stuff that you do not need and you
can filter out aggregates as well.

If we were to add an extra field to SQLTABLE it would
- encourage pulling everything from the DB when it is not necessary
- become very cumbersome for aggregates

Massimo

On May 18, 10:31 am, Timmie <timmichel...@gmx-topmail.de> wrote:
> Hello,
> may it be possible in the next version to add a fields argument to
> SQLTABLE?
>
> This could be very convenient for generating a table with a selected
> number of fields.
>
> This is already implemented in the SQLFORM.
>
> Regards,
> Timmie
>
> Below information from the docstrings:
>
> SQLFORM?
> fields: a list of fields that should be placed in the form, default is
> all.
>
> SQLFORM(db.table,
>        record=None,
>        fields=['name'],
>        labels={'name':'Your name'},
>        linkto=URL(r=request,f='table/db/')
>
> SQLFORM(self, table, record=None, deletable=False, linkto=None,
> upload=None, fields=None, labels=None, col3={},
> submit_button='Submit', delete_label='Check to delete:', showid=True,
> readonly=False, comments=True, keepopts=[], ignore_rw=False,
> **attributes)
>
> SQLTABLE:
> SQLTABLE(self, sqlrows, linkto=None, upload=None, orderby=None,
> headers={}, truncate=16, **attributes)
--~--~---------~--~----~------------~-------~--~----~
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 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to