small proposition for _q_lookup

vincent delft <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
Because I'm an "heavy" user of _q_lookup, I would
propose an improvement.

Why not having the possibility to split the path into
several variables ?
 
Let's take an example:

class Calendar(Directory):
   def _q_lookup(self,year,month,day=1):
       .....

Then, the url:
http://localhost/calendar/2005/07/20
will populate the variable year, month and day
respectively to 2005, 07, 20

Then, the url:
http://localhost/calendar/2005/07
we will have year=2005, month=07 and day=1


Does there is an interest for this (I think yes) ?
Would it be difficult to have such in Quixote ?

or

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


Thanks

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com
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.