url() on viewlets is not updated in trunk
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| grok |
Medium
|
Jan Wijbrand Kolman |
Bug Description
The url() method implementation is duplicated on viewlet and views. This duplication should go away. Right now as a result of this duplication there's also an inconsistency between url on views (which get a data argument) and on viewlet. There are also no tests for the url method on viewlet.
Martijn Faassen (faassen) wrote : | #1 |
Reed O'Brien (reedobrien) wrote : | #2 |
given a viewlet manager:
class HeaderManager(
grok.
grok.
and a viewlet:
class HeaderViewlet(
grok.
grok.
grok.
The view.url method in the header ZPT:
<div id="visual-
<div id="site-header">
<p class="
<a tal:attributes=
accesskey string:2;
title string:Skip to content">Skip To Content</a>
...
generates the url:
http://
which doesn't exist, so giving context is required to generate a working url.
<a tal:attributes=
generates:
Which is correct.
I do not know if this is intended behavior, but per a conversation with philiKON in #grok
(http://
Philipp von Weitershausen (philikon) wrote : Re: [Bug 226555] Re: url() on viewlets is not updated in trunk | #3 |
On 4 May 2008, at 23:16 , Reed O'Brien wrote:
> given a viewlet manager:
>
> class HeaderManager(
> grok.name('header')
> grok.context(site)
>
> and a viewlet:
>
> class HeaderViewlet(
> grok.viewletman
> grok.context(site)
> grok.template(
>
> The view.url method in the header ZPT:
>
> <div id="visual-
> <div id="site-header">
> <p class="
> <a tal:attributes=
> accesskey string:2;
> title string:Skip to content">Skip To Content</a>
> ...
>
> generates the url:
>
> http://
This URL (generated by a viewlet's url() method) is definitely
incorrect. Thanks for providing this bugreport!
Changed in grok: | |
assignee: | nobody → janwijbrand |
importance: | Undecided → Medium |
milestone: | none → 1.0 |
status: | New → In Progress |
Martijn Faassen (faassen) wrote : | #4 |
On Thu, May 8, 2008 at 9:15 AM, Jan Wijbrand Kolman
<email address hidden> wrote:
> ** Changed in: grok
> Status: New => In Progress
> Target: None => 1.0
I'd make this a 0.13 target, not a 1.0 target?
Martijn Faassen (faassen) wrote : | #5 |
On Thu, May 8, 2008 at 1:12 PM, Martijn Faassen <email address hidden> wrote:
> On Thu, May 8, 2008 at 9:15 AM, Jan Wijbrand Kolman
> <email address hidden> wrote:
>> ** Changed in: grok
>> Status: New => In Progress
>> Target: None => 1.0
>
> I'd make this a 0.13 target, not a 1.0 target?
Or even a 0.12.1 target actually
Jan Wijbrand Kolman (janwijbrand) wrote : | #6 |
Yes, it is really a 0.12.1 and 0.13 target. Now, if only I could find out how to actually set it on the issue....
Jan Wijbrand Kolman (janwijbrand) wrote : | #7 |
After discussions on the mailinglist, the consensus appears to be:
* viewlets and viewletmanagers should provide access to the view they're registered for, besides the request and the context.
* the namespaces for the pagetemplates associated with a viewlet or a viewletmanager should be at least: request, viewletmanager, viewlet (the viewlet object itself), view (the view the viewlet[manager] is registered for) and context.
* URLs to views can thus be constructed through the view namespace (being the view this viewlet is regsitered for) as it has the url() method. In other words, the url() method will be removed from viewlet and viewletmanager.
* at some point in the future the suggestions for having URLs to the individual viewlets can be explorered.
* Test coverage for the viewlets should be extended.
Changed in grok: | |
status: | In Progress → Fix Released |
The viewletmanager also has a copy which needs to be consolidated.