durusmail: quixote-users: Where in the URL is Component San Diego?
Where in the URL is Component San Diego?
2003-01-30
2003-01-30
2003-01-30
2003-01-30
2003-01-31
2003-01-31
2003-02-05
2003-02-06
Where in the URL is Component San Diego?
Nicola Larosa
2003-01-30
When evaluating a URL component while in the _q_getname of an object, and
then returning self to get to the next one, it would be nice to know from
which part of the URL is the current component.

It cannot always be unambiguously determined by checking the PATH_INFO in
the request, because the path could be something like /comp/comp/comp, with
the same string appearing more than once. Yes, not necessarily that silly. :^)

Currently one needs to keep a counter in the object, but this is fragile and
error-prone.

A way to get such info would be to keep the current index in the
path_components loop of the Publisher.traverse_url method, at line #547 of
publish.py .

Such an index could then be passed in the call to self.get_component at line
#551, and finally passed to the call of container._q_getname, at line #460
of the same file.

I don't know how this could be done without breaking every Quixote-based
application in existence, but it seems it could be really handy. Maybe a
config option?


In summary, a piece of info Quixote has, that cannot be easily and reliably
reconstructed after the fact, is begging for freedom. Let's help it! ;^)


--
"Python is the Beatles of programming languages."
   Aaron K. Johnson on comp.lang.python

Nicola Larosa - nico@tekNico.net



reply