durusmail: quixote-users: small proposition for _q_lookup
small proposition for _q_lookup
2005-07-20
2005-07-20
2005-07-20
2005-07-20
2005-07-20
small proposition for _q_lookup
vincent delft
2005-07-20
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
reply