[Zope3-dev] Re: form action

Steve Alexander steve@cat-box.net
Tue, 02 Apr 2002 16:56:47 +0100


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.

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.

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.

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?

--
Steve Alexander