Closed Jaymon closed 7 years ago
There are a couple reasonable ways to handle this:
decorators can support classes also as discussed in this other issue
you could have Call.handle
first try Controller.start_handle
and then Controller.start_METHOD
(eg, Controller.start_GET
for GET requests). This would allow you to add shared decorators between GET and POST requests to the start_handle
method and ones that should just be confined to a certain request (like all GET requests from which there could be 3 GET methods to choose from) to be added to start_GET
).
The use case is a Controller that has
GET
andPOST
methods, and wants to have common error checking functionality between the two.This popped up because in one of our controllers we have a
foo
variable that needs to be checked the same for both http methods and there is no reasonable way to do it, currently, the way I DRY'ed it was by doing:Which violates the "this is easy to conceptualize and implement" rule of programming