On Jan 31, 2008 1:46 PM, Harry Mangalam <[EMAIL PROTECTED]> wrote:
>
>
> I tried this:
>
> mail_form = DataGrid(fields=[
> ('Subj', 'p1_mails[0][0]'),
> ('From', 'p1_mails[0][1]'),
> ('Date', 'p1_mails[0][2]'),
> ('Size', 'p1_mails[0][3]'),
> ('Att', 'p1_mails[0][4]'),
> ])
>
> but unsuprisingly, it failed. What is the better way?
>
> After 2 hours of beating my head on this, I of course figured it out
> within minutes of posting. The whole whole point of DataGrid is to provide
> the service by the accessor, which in my case is the query string, "subject"
> for the Subj column. When the stanza is re-written like this:
mail_form = DataGrid(fields=[
('Subj', 'subject'),
('From', 'sender_addr'),
('Date', 'date'),
('Size', 'sz_bytes'),
('Att', 'nbr_attach'),
])
mailgrid=mail_form.display(p1_mails)
it works as expected. Has to be tuned somewhat, but it works (and fast!)
Sorry for the noise.
Harry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---