Thanks Marc& Shai for taking the time to look at this. Apologies for the
late response as I was busy.
Yes, I agree that decorators can be used to tag urls, however I think that
the way that the URL rework code applies decorators can be improved.
The reason I've called the decorators approach 'hea
Assume decorators, then, more or less:
def tagged(*tags):
def decorate(view):
@functools.wraps(view)
def decorated(*args, **kw):
view(*args, **kw)
decorated.tags = tags
return decorated
return d
Some quick thoughts:
- I'm unconvinced that selecting urls by a given type is a common use case
- can you expand on that?
- Implementing the detection and usage of tags as middleware seems not as
nice as in decorators to me, especially as the middleware tree can be...
unpredictable in its behaviou