Gary Doades <[EMAIL PROTECTED]> writes:
> I think that the widgets are definitely the way to go. It's the "big
> picture" that seems to be problematic. I'm not sure that ToscaWidgets
> fixes any of this, but I've only had a quick play with them.
Anyway, you have to remember that you don't need to be limited by the default
widget template or even the default parameters that a widget accepts.
Subclassing a widget and creating your own is really easy!
Take a look at the code for the Select Shuttle for a somewhat complex widget
(I have some that are much more complex, such as one that has 49 input fields
for time inputs -- 42 of them -- and boolean values -- the other 7).
For a simple widget take a look at Submodal.
Those are "100%" custom widgets. But you can also subclass a widget just to
change its template -- it might be worth if you're using this alternative
template in several places to avoid having to specify the new template every
time -- or even add new parameters. Wanna see an example?
class MyPaginate(widgets.PaginateDataGrid):
template = 'my_app.templates.my_paginate_template'
params = ['extra1', 'extra2']
Then I can pass values for "extra1" and "extra2" when I call my instance of
MyPaginate (or when I subclass it).
Those can be used to render the widget differently on a per request basis as
you're both wanting.
> I think the other problem is the multi-threading stuff. In my 20 years
> doing software I've come across people who just cannot get it, no matter
> how much you explain it. Sometimes I have to just step back and re-think
> what is going on in a multi-thread environment and then sort the code
> out appropriately.
Add to that another problem: the web is *stateless*. There's nothing that
says that when you submit a form you'll get the same thread / process that
generated it.
> In the web environment you've got this dynamic "every request is
> different" approach, yet with this type of framework/application you
> always seem to be thinking so hard about concurrent re-use of a pool of
> static resources. Sometimes it just makes my head hurt :)
It is hard until you get it in your veins. ;-) After that you get used to it
and it is simple to work with.
> I'm sure we will get there.....
I have no doubt.
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---