Shouldn't be hard to implement that decorator, though. I'll try later (at
work now) because this is useful.
Regards,
Tiago
On Fri, Feb 12, 2010 at 12:19 AM, minh mdn0...@gmail.com wrote:
Is there a way to require arguments/vars in the controller functions
other than explicitly checking for
Hello, I think i've finished doing this but I'm having trouble
accessing the request object from the decorator function.
How would you define a decorator that accesses the request?
I have something like this
class require_args(object):
def __call__(self, f):
def
Sorry, spoke too soon. I saw how auth works and did something similar.
right now it is something like this, mind that names can be changed:
@req_args.requires_validVars( 'www.google.com',
('search',),
('search','highlight'))
first param is where to redirect on error
what about default cases.
I don't need to redirect if a var does not exist, but instead use a
default value. Perhaps a dict instead of tuples ?
-Thadeus
On Fri, Feb 12, 2010 at 7:53 PM, Tiago Almeida
tiago.b.alme...@gmail.com wrote:
Sorry, spoke too soon. I saw how auth works and did
Yes it's a possibility!
--
Tiago
On Sat, Feb 13, 2010 at 2:06 AM, Thadeus Burgess thade...@thadeusb.com wrote:
what about default cases.
I don't need to redirect if a var does not exist, but instead use a
default value. Perhaps a dict instead of tuples ?
-Thadeus
On Fri, Feb 12, 2010
Is there a way to require arguments/vars in the controller functions
other than explicitly checking for them?
It would be nice if we could decorate the functions similar to how the
auth works, ex:
@require_arg_function(minargs=2, message=Invalid arguments)
def some_function():
Thanks.
if not request.args(0):
redirect() or default = hi
-Thadeus
On Thu, Feb 11, 2010 at 6:19 PM, minh mdn0...@gmail.com wrote:
Is there a way to require arguments/vars in the controller functions
other than explicitly checking for them?
It would be nice if we could decorate the
7 matches
Mail list logo