[Zope] aquistion probleme

Paul Winkler pw_lists at slinkp.com
Fri Sep 16 11:36:11 EDT 2005


>
>
> hello
>
> I'm trying an acquisition, but I must be doing something wrong...
>
> I've got a setting like this :
>
> /dir1/dir2_1/dir3_1
> /dir1/dir2_2/dir3_2
> /dir1/dir2_2/img.jpg
> /img.jpg
>
> I write somthing like :
>  context['img.jpg'].absolute_url()
>
> I expect to get /dir1/img.jpg, in all cases

Why do you expect that? There is no img.jpg in dir1.
Also, absolute_url() includes protocol, server, port, and
virtual hosting configuration if you are using one.
So, if there is no virtual hosting in effect, you should expect
http://your_server:your_port/img.jpg

> but when the script
> runs from /dir1/dir2_2/ and /dir1/dir2_2/dir3_2

In that case you should expect to get
http://your_server:your_port/dir1/dir2_2/img.jpg
(with modifications for virtual hosting if applicable).

> unfortunately, that's not what happends...

what DOES happen? Always a good idea to include that information
with problem reports :-)

-PW




More information about the Zope mailing list