views.Feed methods cannot be decorated
|Reported by:||Germano Gabbianelli||Owned by:||Andriy Sokolovskiy|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If one applies a decorator on a method which is called by
TypeError like this occurs:
Exception Type: TypeError at /blog/feed/ Exception Value: item_link() takes exactly 2 arguments (1 given)
I think this is because
__get_dynamic_attr tries to count the function's arguments, but decorators usally get defined with the
*args, **kwargs syntax, so this trick does not work here.
if code.co_argcount == 2: # one argument is 'self' return attr(obj) else: return attr()
I think the best approach would be to remove one of the two methods. IMHO We should have either
attr() not both, as "there should be one, and preferably only one, obvious way to do it".