[Zope3-dev] Re: form action

Guido van Rossum guido@python.org
Tue, 02 Apr 2002 11:28:54 -0500


> Guido van Rossum wrote:
> >
> >>In the odd mozilla case above, it looks like mozilla is using the base 
> >>href: http://localhost:8080/jl/new/index.html
> 
> 
> > I'd be for fixing the BASE HREF not to include the "index.html" part.

[Steve A]
> I agree. However, this is not straightforward for the job board example.
> 
> The URL above can be understood as:
> 
>    href: http://localhost:8080/jl/new/index.html
> 
>    server                     JobList
>                                   special new Job generated from Request
>                                       default method of default view
> 
> If we just remove "index.html" from the end, we're left with the content 
> object (the special new Job), whereas we should have the Job's default view.
> 
> So, the base href should be http://localhost:8080/jl/new/JobView;view
> or just http://localhost:8080/jl/new/JobView.
> 
> Except that this doesn't work... I guess that's to do with how 
> JobListTraverser works; it is designed to directly return views of its 
> job objects.

Correct.  I want the URLs that the user sees not to have any views
attached.  I've been struggling with this a lot, and I'm sure it can
be done better, but what I definitely do *not* want to see is that the
effective URL is something like this:

  /jl/new/edit/index.html

or even worse, like this:

  /jl/new/edit;view/index.html

> The way I have seen other Zope 3 packages work is that the 
> ContainerTraverser would return one of its subobjects (a content 
> object), and then that would be traversed for the appropriate view.

I tried that before, and it gave the ugly effective URLs above.

> In order for the jobboard to work like this, the JobListTraverser would 
> have to collude with the request to get the view it wants for its Jobs.
> Which sounds like more work and more complexity than we have in the 
> existing JobBoardTraverser.
> 
> Perhaps there's a way for the existing JobBoardTraverser to tell the 
> Request what view it has chosen for its Job, so that the Request can 
> generate an appropriate base?

Who knows?

I'm hoping that we'll get default views.

--Guido van Rossum (home page: http://www.python.org/~guido/)