T
T
timehollyname2021-08-25 17:40:27
Django
timehollyname, 2021-08-25 17:40:27

How to correctly implement models depending on the type?

Hello, can someone please tell me how to correctly implement models of this type:

There is a map, the map has a type and, depending on the type of map, certain fields are filled in, each type has different fields, but the map also has common fields.

Right now it's done like this, 1 model and all fields are in this model, but depending on the type, only the necessary fields are used. Maybe something better can be done, otherwise the model can spread from the fields

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-08-25
@timehollyname

https://docs.djangoproject.com/en/3.2/topics/db/mo...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question