On Sep 27, 2006, at 9:31 AM, Sanjay wrote:

>
>> P.S: You can use a widget instead of a function. It will receive obj
>> as it's value and you can do all sorts of fancy stuff with it. Keep
>> in mind that calling a widget is the same as "display()"ing it.
>
> Great! I was pondering how to put some checkboxes, textboxes etc.
> inside datagrid, and this seems to be the ideal way!
>
> But being a novice, I am not being to do it. Tried this:
>
> name_textbox = TextField('name')
> sortable_person_list = PaginateDataGrid(
>     fields=[
>         PaginateDataGrid.Column('name', name_textbox, 'Name',
>                                 options=dict(sortable=True)),
>         PaginateDataGrid.Column('age', 'age', 'Age',
>                                 options=dict(sortable=True,
> reverse_order=True)),
>     ])
>
> While running, I do get a textbox, but the textbox contains
> <Person 1 name='dummy1' age=1>
> in stead of just
> dummy1.

You need to define a __str__ mehtod for your object which returns a  
human-readable name. Something like

def __str__(self):
        return self.name

Alberto

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to