Re: small proposition for _q_lookup

David Binger <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
On Jul 20, 2005, at 12:18 PM, vincent delft wrote:
>
> Why not having the possibility to split the path into
> several variables ?
>
> Would it be difficult to have such in Quixote ?

One way to do this is to override the _q_traverse and have
it call your _q_lookup the way you want, instead of just
passing the first component on the rest of the path.

Maybe, in _q_traverse(), you would want

   obj = self._q_lookup(component, *path)

instead of

   obj = self._q_lookup(component)



>
> do you prefer to continue with somethink like:
> Class Calendar(Directory):
>    def _q_lookup(self,comp):
>        day=1
>        month=1
>        for i, value in enumerate(comp.split('/')):
>            if i==0: year=value
>            if i==1: month=value
>            if i==2: day=value
>

This won't work because the component never has any '/' characters.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.