Overriding or Changing Admin Templates in Django 1.11 -
my general goal make data in /admin/my_app/my_model/<id>/change/
not editable or link goes page go url that's view
instead of change
.
i'm having lot of trouble figuring out how extend these templates. lot of tutorials , docs see talks of changing templates in /templates/admin
feeling that's been deprecated in 1.11.
no, it's not deprecated. copy django/contrib/admin/templates/admin/change_list_results.html
(it describes each line of models list) own project's templates/admin/
, change wish, example add column link @ end of row. beware of writing model specific stuff spread models. if still need it, store stuff in model classes.
another point django admin app not intended viewing data, it's main purpose edit it. have quick inside source files , understand point.
all can change custom modeladmin class , forbid adding , deletion overriding has_add_permission
, has_delete_permission
methods , set fields read-only, still see save buttons everywhere. if not option you, declare custom view inside of modeladmin or adminsite class , add admin site urls.
Comments
Post a Comment