Obviously the data is not in the correct format, but what should it look like?
The idea is to just reuse existing, well tested sql queries from a pyqt application , which we intend to port to tg2 , without going thru sqlalchemy magic.
Thanks for any pointers
Db
Simone Marzola
unread,
May 12, 2012, 7:18:06 AM5/12/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to turbo...@googlegroups.com
Hi,
if you define the getter of the grid column as a string, it will be used to return the value of an object attribute (getattr(obj, name)). If you want to define a custom accessor, the getter must be a callable that defines the column behavior. In specific:
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to turbo...@googlegroups.com
Yes it is possible, but Datagrid expects values to be objects with
attributes instead of a dict.
To workaround this issue you can store the values (or convert the dict
to) a tg.util.Bunch object which will provide access both with
__getitem__ and __getattr__.
In any case DataGrid permits to pass any callable to retrieve the
column values when declaring the fields attribute instead of property
name.