9
9
95506682020-08-01 00:12:16
Django
9550668, 2020-08-01 00:12:16

How to structure CBW?

Good day to all.

My question is the correct structuring of CBW in DJANGO, namely:
1. If I use the same functions in a number of CBWs, should I make a separate class with these functions and inherit this class?
For example, is there a standard response when using an incorrect method of sending a request to the server? (Method GET is not allowed answer)
2. If you use inheritance, is it worth making the base_functions module separately, for example, and importing it into the app via from base_functions import FUNCTION?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-08-01
@bacon

1. Under the description, these are mixins, how to use them https ://docs.djangoproject.com/en/3.0/topics/class...
to the app to which this function is closest.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question