[Zope] Impossibly long urls

David Beech dbeech@bigpond.net.au
Wed, 31 Jul 2002 18:29:28 +1000


Hello folks,

The saga continues ...

>From a Python script I use a return statement like:

return container.xxx.yyy.zzz.aaa(container.REQUEST)

aaa is a dtml doc and the REQUEST object has had some attributes 
set that aaa will use. aaa is nested down in the tree xxx.yyy.zzz

The result of this is that it seems that Zope appends the return 
value to the calling URL, hence it gets longer and longer and 
when returned Zope does things I rather it didn't, like 
rerunning SQL methods.

If I apply absolute_url to this as in:

return container.xxx.yyy.zzz.aaa.absolute_url()

I get a string returned not a renderable object.

I try another strategy and do

return context.xxx.yyy.zzz.absolute_url() + '/aaa'

expecting to force a redirect but it fails. Deep sighs.

I want to return object references from Python scripts as 
absolute urls and obviously I am doing something wrong, wiping 
out (if necessary) the original url (which I guess comes from 
the REQUEST).

Any suggestions gratefully received and pursued.

cheers

David



On Wed, 31 Jul 2002 15:10, you wrote:
> Use dynamically-generated absolute URLs, e.g.:
>
> <a href="&dtml-absolute_url;/something">Foo</a>
>
> Instead of relative ones, e.g.:
>
> <a href="something">
>
> This is somewhat of a FAQ, although there's no document with
> an A. ;-)
>
> - C
>
> On Wed, 2002-07-31 at 00:58, David Beech wrote:
> > Hello folks,
> >
> > Can anyone explain why my Zope apps generate loooooooooooong
> > urls?
> >
> > It seems that each action (clicking a button or an href)
> > results in the target (the object being called) being
> > appended to the current url which is submitted to the
> > server.
> >
> > I've pored over the various Zope references but nothing
> > sticks out as obvious.
> >
> > I've tried specifying the path directly to a Zope object in
> > both Python scripts and dtml documents, and also used
> > relative linking where possible. The effect is always the
> > same and apart from causing the server to overwork it also
> > leads to problems with database operations.
> >
> > Any help will be much appreciated.
> >
> > cheers
> >
> > David
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )