On Oct 29, 5:15 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> "Nevyn" <[EMAIL PROTECTED]> writes:
> > yeah, that is what I have, except that I always get "name first is not
> > defined" when I try and use the widget, if I put it in a kid template
> > it works fine. Here is the code for the widget.

>Now you changed your question.  You haven't said us that you wanted those in
> your widget.

I did, the very first message.

"basically I have a method that returns arguments from the URL ( first
and last ) and I have a method that returns a widget/datagrid, what I
would like to do is pass the peoples names from the URL into the
widget and when the widget is called, dynamically display their name
as a header/caption. " 




>So, you need to insert first and last in the dictionary with
> data that your widget will receive.
>
> > I call the widget from kid with "${projwidget.display(projects)}"'projects' 
> > will have to contain both 'first' and 'last' entries here.  How are
> you getting it?

well, that leads to the questions .. the first and last come from the
URL  e.g. "foo.com/method/first/last/



class ProjWidget(widgets.Widget):

        template = '''
        <table xmlns:py="http://purl.org/kid/ns#"; class="main"
border="0">
        <td> ${first} ${last} </td>
                <tr>
                  <th>Team</th>
                  <th>Group</th>
                  <th>Enemy</th>
                </tr>

                <tr py:for="data in value">
                        <td py:for="d in data">
                                <a  href='${d}'>${d}</a></td>
                </tr>

        </table>'''

projwidget = ProjWidget()
def method(self, first='firstname', last='lastname'):
        ...
        return dict(first=firstname, last=lastname, projects=projects,
projwidget=projwidget)

this works in the kid template, but not in the widget. I am wondering
if I am missing something in the widget.

all the stuff you guys haevg mentioned so far has helped a lot. thanks.


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