On Sep 7, 6:35 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> Em Sunday 07 September 2008 13:16:31 Ben Sizer escreveu:
>
> > Example: I have a GridOfNumbers widget, which displays several columns
> > of numbers. In addition to the numbers, it also takes a display_type
> > parameter (integer, ranging from 1 to 3) that specifies how I want to
> > show those numbers. Imagine also I have 3 corresponding functions -
> > number_as_digits(), number_as_roman_numerals(),
> > number_as_english_words() - each taking an int and returning a string.
> > The idea is that the widget filters all output through one of these 3
> > functions, based on the display_type parameter provided.
>
> Degradation apart, I'd make this using JavaScript.  Probably some AJAX if you
> already have everything in place on the controller...

It's not something the end user gets to choose.

> > The data could be pre-processed in the controller, but this is purely
> > about presentation, so the controller is the wrong place for this.
> > This functionality should be in the template, or the widget.
>
> The controller can supply all alternatives.

The controller shouldn't have to worry about presentation. That's why
it's called the controller and not the view. (Sorry to sound
facetious.)

--
Ben Sizer

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