Search code examples
djangosingle-table-inheritancesti

How do you do Rails' polymorphism/STI in Django?


I came across Proxy models in Django but they don't create the single-table polymorphic columns (polymorphable_id, polymorphable_type). Is there any way to create sti/polymorphism in Django?


Solution

  • My team has used django-polymorphic for this before:

    https://github.com/django-polymorphic/django-polymorphic

    It is well maintained and has a lot of nice features. Good luck!