Hi Michele,

It took me a bit longer to get back to this one.

On 11/4/05, Michele Cella <[EMAIL PROTECTED]> wrote:
> This is a feature I didn't notice, and I think that's a quite important
> feature, If i got it right you are directly referencing a Kid template,
> right?
> Now I will not say again "see below" but I will describe my ideal
> scenario:
>
> Since you can reference a widget template this way, I think that maybe
> you should not hardcode it in the source code like you're doing ATM.
> So, regarding quickstart, customization by designers and consistency...

The default templates need to be stored somewhere, of course. Since
these initial ones were pretty small, I decided to just stick them in
there with the code. They remain easily overrideable.

> What about extending the quickstart command so that it creates a new
> widgets directory under the application template folder:
>
> apppackage.templates.widgets
>    |__ form.kid
>    |__ textfield.kid
>    |__ colorpicker.kid
>
> by default this folder will just contain the TG implementation of
> widgets, so for instance form.kid will look like this:

This makes updating painful. If the widgets are well-written, most
people won't be overriding many widgets for their projects. But, if
they had a copy of all of the templates then for each update of
TurboGears they'd have to regenerate templates that had been updated
with changes to the widgets.

What I would be in favor of is making a widgets.py file with a couple
of override samples.

> Now, I think you can just rename TableForm to be Form and (dunno if
> it's possible) use as a reference the kid template of the application
> (instead of hardcoding it on as a class attribute, again Controller and
> View separation).

Form will actually be a base class, and there will be a couple
different standard varieties (that will likely only vary in the
template they use).

> To make this work there should be a very good and simple plugin system
> for widgets so that you can easily deploy them on your TG app (with
> their templates, javascript and css). That's why I think quickstart
> should just copy on the application template folder all widget provided
> by TG itself, this is quite important to give designer an easy way to
> customize without the need of copy/paste the base template that TG uses
> by default from some others (obscure) locations.

Because widgets are standard Python modules with some additional
resources, they can be deployed easily as eggs.

I have a plan for providing easy access to the widget templates when
you want to update them.

> Hope I've been able to express my idea. :D

Yes, indeed... and I hope my thoughts on this become a bit clearer as
I get some of my ideas out there in code.

Kevin

Reply via email to