RE: automatic type conversion from URL parameters Options

2011-09-07 Thread joshjdevl
> One solution to your problem could be to write a decorator that takes a > list of types (plus something like None for "don't care") and > automatically converts argument N to thetypein the N-th element of the > list before calling your function. Is there an example or tutorial showing how to wri

Re: automatic type conversion from URL parameters

2011-09-07 Thread joshjdevl
> One solution to your problem could be to write a decorator that takes a > list of types (plus something like None for "don't care") and > automatically converts argument N to thetypein the N-th element of the > list before calling your function. How would one write a decorator to take a list of

Re: automatic type conversion from URL parameters

2008-02-25 Thread Malcolm Tredinnick
On Mon, 2008-02-25 at 00:07 -0800, webheld wrote: > hi django guys, > > is there a simple way to convert URL parameter for views > automatically? > > let's say I have in my urls.py: > > (r'^myview/(\d+)/', 'myview') > > and I know that myview will *always* receive an int parameter, can > djan

automatic type conversion from URL parameters

2008-02-25 Thread webheld
hi django guys, is there a simple way to convert URL parameter for views automatically? let's say I have in my urls.py: (r'^myview/(\d+)/', 'myview') and I know that myview will *always* receive an int parameter, can django convert this type somehow automatically? thanks a lot, michael --~--~