I am trying to use crud.select but am encountering an issue when I
customise the list of fields.

This code provides a clickable link for the 'id' field, but doesn't
have customised headers:
table=db.my_table
query = table.id > 0
fields = [f for f in table.fields if table[f].readable]
rows=db(query).select(*fields)
headers={}
for field in rows.colnames:
    # Use custom or prettified label
    headers[field]=table[field].label
list=crud.select(table,headers=headers)

This code displays customised headers, but doesn't have a clickable
'id' field:
list=crud.select(table,fields=fields,headers=headers)

The problem appears to be in SQLTABLE (gluon/sqlhtml.py)

With the customised list of fields, then we enter this part of the
loop:
if not table_field.match(colname):

I think that the custom headers have somehow changed the value of
sqlrows.colnames
If I comment this out then it blows up when trying to:
(tablename, fieldname) = colname.split('.')

I can't see how to get this resolved...

Many thanks for any help :)
Fran
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to