On 10/29/06, Lord Galrion <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
>
> I hope I don't get flamed but I am very new at python and turbogears.
> I not sure that I can even ask the question correctly. So please be
> tolerant of me.
don't worry we don't flame :)
> My confusion is in this example
>
> I have a Class which has two methods that returns a dictionary with a
> datagrid using a widget
>
> my classmates want to see their names as a header above the datagrid
> by passing there names from a URL ( I hope this makes sense )
>
> I read the docs, and know I can create a method like,
> which either the URL ../first/last or via ?first=first&last=last will
> work but I don't know how to combine both the datafrid widget method
> and the names method to display together. I am totally lost.
>
just one comment there it's not "best practices" to have both work
based on the protocol description the GET (?var=val) should be used to
retrieve data only, and having a first/last where first/last actually
are variables to the same request is kind of overkill unless your
doing some call "REST urls" in which basically the last element in the
path is an action to take. So the "correct" way to do this is with a
POST message in which case you will probably want a form that will
"hide" the data from the URL but still get it there. unless your doing
a read only request in which case a GET is also aceptable.
> Please advise me how to solve this. Know also that, I know I can
> create a model with student's names, but this is not what I want, I
> want to understand how to do this because it seems I am missing
> something very fundamental which will teach me python and turbogears
> more.
>
just one thing remenber the Widget needs "an iterable" so you can in
your controller create a list that will only have first and last names
and send that to the widget. for example.
[('jorge','vargas'),('nevyn','exile')]
> Thanks guys,
> Nevyn
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---