Answer the question
In order to leave comments, you need to log in
Dajngo - how to use one table for two models?
New to django. It is necessary to use one table, but the goals are different + different managers. Therefore, the question arose, to create a copy of the model (that is, to register all the fields) or to somehow inherit? Tell me the right way.
I use class-based views
Answer the question
In order to leave comments, you need to log in
You most likely have the wrong architecture.
1 table for two different models is a bad decision.
1 model - 1 table.
Why is that bad?
1. The code is written in order to be easy to read - especially in python.
2. Imagine that in 3 years you or another proger will open your project - how quickly will he understand this implicit trick with 1 table for 2 models?
3. Don't go all out - redefining managers is tricky stuff, try to get a good base in Django first.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question