Team-uMigrate / umigrate

Source code for the uMigrate project
13 stars 2 forks source link

API: Combine common API view decorators #390

Closed deandrebaker closed 3 years ago

deandrebaker commented 3 years ago

We tend to use the same 6 class decorators over ever model view set class, with the only difference being the list of strings representing the tags.

image

We should create a new class decorator that takes in a parameter representing the list of tags, and applies all 6 of these decorators to the class.

We can then repeat for these 2 decorators as well. image

To create a decorator in python, checkout https://www.geeksforgeeks.org/chain-multiple-decorators-in-python/