Roy Smith wrote:
Is there any way to conditionally apply a decorator to a function?
For example, in django, I want to be able to control, via a run-time
config flag, if a view gets decorated with @login_required().
@login_required()
def my_view(request):
pass
Hi,
def my_view(request):
On 06/19/2012 02:23 AM, Rob Williscroft wrote:
Roy Smith wrote in news:jro9cj$b44$1...@panix2.panix.com in
gmane.comp.python.general:
Is there any way to conditionally apply a decorator to a function?
For example, in django, I want to be able to control, via a run-time
config flag, if a view ge
Roy Smith wrote in news:jro9cj$b44$1...@panix2.panix.com in
gmane.comp.python.general:
> Is there any way to conditionally apply a decorator to a function?
> For example, in django, I want to be able to control, via a run-time
> config flag, if a view gets decorated with @login_required().
>
> @
On Mon, Jun 18, 2012 at 6:49 PM, Emile van Sebille wrote:
> On 6/18/2012 3:16 PM Roy Smith said...
> class myDecorator(object):
> def __init__(self, f):
> self.f = f
> def __call__(self):
> print "Entering", self.f.__name__
> self.f()
> print "Exited", self.f.__na
On 6/18/2012 3:16 PM Roy Smith said...
Is there any way to conditionally apply a decorator to a function?
For example, in django, I want to be able to control, via a run-time
config flag, if a view gets decorated with @login_required().
@login_required()
def my_view(request):
pass
class
On 18/06/2012 23:16, Roy Smith wrote:
Is there any way to conditionally apply a decorator to a function?
For example, in django, I want to be able to control, via a run-time
config flag, if a view gets decorated with @login_required().
@login_required()
def my_view(request):
pass
A decora
r...@panix.com (Roy Smith) writes:
> Is there any way to conditionally apply a decorator to a function?
> For example, in django, I want to be able to control, via a run-time
> config flag, if a view gets decorated with @login_required().
>
> @login_required()
> def my_view(request):
> pass
Y