S
S
SexyHair2020-08-07 01:09:51
PostgreSQL
SexyHair, 2020-08-07 01:09:51

How to implement a polymorphic model in Django?

I would like to know how to implement a polymorphic model in Django? I know that there is a django-polymorphic module, but it is no longer supported. So far, it only comes to mind to implement all fields within one model, and simply specify None for unnecessary ones. Django3.0, python3.8, if it matters then the DB is postgresql

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-08-07
@SexyHair

In addition to django-polymorphic, there is also django-model-utils with its InheritanceManager.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question