Christoph Zwerschke wrote:
Am 14.04.2010 12:07, schrieb jose soares:
My source is a query object of SA and data comming from db already
sorted but when I click on the column title, paginate tries to ordering
it again and raises this error.
In this case, ordering should normally happen in the database. Can you
show us your controller code? Also, which SA version are you using?
-- Christoph
sa 0.6beta3
and this is my controller...
gridFields=[ #campi della grid
NewSelectablePagDataGrid.Column(name='specie_codice',
title='codice', options=dict(sortable=True)),
NewSelectablePagDataGrid.Column(name='specie_descrizione',
title='descrizione', options=dict(sortable=True)),
NewSelectablePagDataGrid.Column(name='specie_cod_gruppo_specie',title='gruppo
specie',options=dict(sortable=True),
getter=lambda lfs:lfs.gruppo_specie and
lfs.gruppo_specie.gruppo_specie_descrizione or ''),
NewSelectablePagDataGrid.Column(name='specie_data_fine'
,title='fine validita',options=dict(sortable=True))
]
class Controller(object):
@tg.expose(template="kid:sicer.BASE.view.templates.edit")
@tg.paginate(var_name='grid_params', max_limit=None,
dynamic_limit='limit')
def index(self):
records = Specie.query()
return dict(
grid = PaginateDataGrid(fields=gridFields),
grid_params = records
)
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en.