[Zope] Impossibly long urls

Chris Withers chrisw@nipltd.com
Thu, 01 Aug 2002 10:02:46 +0100


David Beech wrote:

>>>return container.xxx.yyy.zzz.aaa.absolute_url()
>>>
>>>I get a string returned not a renderable object.
>>
>>Well indeed, what were you expecting? Actually, your first
>>example returns a string too, just a long one with lots of
>>HTML in it ;-)
> 
> Which is what I am expecting but it's not an absolute url unless
> we want to call an absolute url an url which contains much 
> repetition of paths.

That is strange... absolute_url is usually fairly good about this kindof thing 
unless you're doing any funny acquisition rewrapping. Are you?

> If a script executes 
> 
> return container.xxx.yyy.zzz.aaa(container.REQUEST)
> 
> isn't that a reference to a Zope object? 

No, that just returns a string containing lots of HTML, rememer earlier? ;-)

 > and doesn't that
> reference return an URL?

No, 'cos it's just a string...

> 1 Web client views form, fills form fields, submits form

The above is your ZPT..

> 2 Submit calls Python script

And we're talking about this script, right?

> 3 Script does database op

fine.

> 4 Script returns another web page

SO, you _do_ want this at the bottom:

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

...but I'd recommend that your ZPT gets its data from an SQL query rather than 
the REQUEST, as Paul suggested.

> all of which works but the url gets longer and longer.

hmmm... I find this strange.

Idea: Can you post the code that generates the FORM tag in your editing form? 
I'm interested to see what the action is...

cheers,

Chris

> 
> Thanks Chris
> 
> cheers
> 
> David
> 
>