Hi Alberto,

I've looked at various threads and I think I am close, except for a
little detail that escapes me.
Here's what I have:

I create a Widget class derivative:

class MakeImgTag(Widget):
    params = ['picture_url']
    template='''<img src="${picture_url}"/>'''

inside my Root method, I declare the PaginateDataGrid fields as
follows:

        pacts_field = [
            ('ID', 'id'),
            (PaginateDataGrid.Column(name='Picture',
                getter=MakeImgTag(picture_url='picture_url'))),
            ...

based on this object inside model.py:

class Pact(SQLObject):
    picture_url = StringCol(length=150, varchar=True,title="Main
Picture URL")
    ...

and on the rendered page I got the following:

    <img src="picture_url">

So it's obvious that I don't know how to pass the *value* of the
object field named 'picture_url' into the PaginateDataGrid.Column()

Any pointers?

Will

On Aug 28, 3:34 pm, Alberto Valverde <[EMAIL PROTECTED]> wrote:
> On Aug 28, 2007, at 9:50 PM, shadowfox wrote:
>
>
>
> > Hi all,
>
> > Can anyone direct me to show a picture in a DataGrid widget, or
> > recommend another widget to accomplish this.
>
> > Hopefully I'm not the only one who needs this feature.
>
> Check out this thread:http://tinyurl.com/2l34vh
>
> 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to