morlandi / django-ajax-datatable

A Django app which provides the integration of a Django project with the jQuery Javascript library DataTables.net
MIT License
204 stars 64 forks source link

implement datatable on abstract model and get data from submodels #59

Closed RobinPalletFly closed 2 years ago

RobinPalletFly commented 2 years ago

I have a base abstract model which other models inherit from. Is there a way for AjaxDatatableView to take this class and display data from all of the objects of the inherited models?

etiennepouliot commented 2 years ago

I also use an abstract model and everything is working fine.

Did you define your columns_def ?

morlandi commented 2 years ago

You might want to try using get_column_defs() instead of defining a static columns_def list. This way, you could adjust the list of columns at runtime. I never did it, however.