djangodjango-modelsdjango-rest-frameworkdjango-simple-history

How can I register model created by django-simple-history on admin site?


So, I got a model Question that has a history saved in the model HistoricalQuestion by the django-simple-history package, how do I register it to django admin site?

Other model registering is straightforward

admin.site.register(models.Event)

But I am not sure how to get it for that package models.


Solution

  • The solution was actually quite simple actually. All I had to do was"

    admin.site.register(models.Question.history.model)
    
    

    Where Question is my model name.