[Grok-dev] module_info, template, grokcore.view

Christian Klinger cklinger at novareto.de
Mon Mar 26 12:19:29 UTC 2012


Hi Sylvain

+1

I stumbled over this here and there.

Christian

Sylvain Viollon schrieb:
> Hello,
>
>     I still use the view.static behavior, with grokcore.view. I don't know if you do guys.
>
>     I am often annoyed by one point however. I mostly (95% or the time) use the view.static in a template. However if I inherit my view in an another package, I keep my template, but the view.static is different, and I loose access to the resources.
>
>     For me, static is linked to the template. I think it should be 'kept'.
>
>     For the moment static is an adapter that is queried with the name of the package that contains the view. I propose to change this to the name of the package that contains the template.
>
>     I poposed to add an attribute __static_name__ (or something else) on the view, that would be initialized by the template registry (in templatereg, associate_template) with the value of the module_info.package_dotted_name if there is an association.
>
>     In the view base class, the static adapter would be looked using this name if set, or will default to the one contained in the view's module_info.
>
>     What do you think of this ?
>
>    Regards,
>
>    Sylvain,
>
> PS: Yes that may break applications, but the result should be more useful, I think.
>



More information about the Grok-dev mailing list