viewflow / django-material

Material Design for Django
http://viewflow.io/
BSD 3-Clause "New" or "Revised" License
2.48k stars 424 forks source link

Material ModelViewSet DetailModelView: Limit the model fields shown in the details page #504

Closed RAJKRIS closed 3 years ago

RAJKRIS commented 3 years ago

It seems that the DetailModelView currently does not have to provision to hide fields. It always shows the all the fields of a model in the detail page.

We can use get_object_data method to override the fields to be displayed. But this doesn't seem to be a straightforward way.

Please advise if I am missing something.

Django-material version: 1.5.6

kmmbvnr commented 3 years ago

The best way to override object representation in the detail view is to override the view template http://docs.viewflow.io/frontend_crud.html#material.frontend.views.DetailModelView.get_template_names