# Some potential bugs found when making custom admin pages

**URL:** <https://forum.djangoproject.com/t/some-potential-bugs-found-when-making-custom-admin-pages/46049>\
**Category:** Django Internals\
**Created:** [September 18, 2026, 4:25pm UTC](https://forum.djangoproject.com/t/some-potential-bugs-found-when-making-custom-admin-pages/46049 "2026-09-18T16:25:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mah-Rye-Kuh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mah-rye-kuh/32/18416_2.png) [@Mah-Rye-Kuh](https://forum.djangoproject.com/u/Mah-Rye-Kuh)\
**Post date:** [September 18, 2026, 4:25pm UTC](https://forum.djangoproject.com/t/some-potential-bugs-found-when-making-custom-admin-pages/46049/1 "2026-09-18T16:25:29Z")

</div>

When preparing custom admin pages for an upcoming presentation, I found some inconsistencies in the admin.

One has already been picked up; I’d like some confirmation if the other items are bugs or intentional.

NB. Feel free to create Trac issues for these items if desired and post them in the comments, or I will do so later.

1. **Python** —Most admin pages require `model._meta` to set `opts`; calling underscore functions is undesirable. Should there be a non-underscore function to retrieve these?
2. **Python** —Missing variable `module` in some views (e.g., model history view has it, change form doesn’t). Especially noticable in the breadcrumbs block.
3. **CSS** —Missing padding for `ol` in `base.css` (near line 654), selector `.module p, .module ul, .module h3, .module h4, .module dl, .module pre`.
4. (No confirmation needed): [#37332 (Admin `list_display` does not show icon for generated boolean fields)](https://code.djangoproject.com/ticket/37332).

**Related code:**

- [`admin/options.py`](https://github.com/django/django/blob/main/django/contrib/admin/options.py);
- [`admin/templates/admin/object_history.html`](https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/object_history.html);
- [`admin/templates/admin/change_form.html`](https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/change_form.html).

_(Applies to other admin templates as well.)_

**My examples:**

- [`mysite/admin_custom/views/base.py`](https://github.com/MHLut/django-local-test/blob/develop/src/mysite/admin_custom/views/base.py);
- [`todo/admin.py`](https://github.com/MHLut/django-local-test/blob/develop/src/mysite/todo/admin.py) (specifically `TodoListFullDetailView`);
- [`todo/templates/admin/todo/todolist/full.html`](https://github.com/MHLut/django-local-test/blob/develop/src/mysite/todo/templates/admin/todo/todolist/full.html).

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 18, 2026, 5:37pm UTC](https://forum.djangoproject.com/t/some-potential-bugs-found-when-making-custom-admin-pages/46049/2 "2026-09-18T17:37:51Z")

</div>

> [@Mah-Rye-Kuh](#):
>
> 1. **Python** —Most admin pages require `model._meta` to set `opts`; calling underscore functions is undesirable. Should there be a non-underscore function to retrieve these?

The `_meta` attribute was intended to be an internal API, but has shown itself to be extremely useful as a public attribute. It is a well-known exception to the Django attribute naming convention, and is so well-entrenched at this point that it is highly unlikely to ever be changed.

You can redefine it yourself in your applications, but I’d be very surprised to see it become a core change. (Just adding an alias runs the risk of creating conflicts with other packages that already use that name for their own purposes.)

---

<div class="post-metadata">

**Author:** ![adamchainz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/adamchainz/32/26_2.png) [@adamchainz](https://forum.djangoproject.com/u/adamchainz)\
**Post date:** [September 18, 2026, 10:04pm UTC](https://forum.djangoproject.com/t/some-potential-bugs-found-when-making-custom-admin-pages/46049/3 "2026-09-18T22:04:55Z")

</div>

> [@KenWhitesell](#):
>
> The `_meta` attribute was intended to be an internal API, but has shown itself to be extremely useful as a public attribute.

Yeah.It was formalized as public API in Django 1.8: [Django 1.8 release notes | Django documentation | Django](https://docs.djangoproject.com/en/4.2/releases/1.8/#model-meta-api) . Maybe we can interpret the “private” underscore prefix more as “you don’t normally need this, but if you do it’s here…”.

> [@Mah-Rye-Kuh](#):
>
> 1. **Python** —Missing variable `module` in some views (e.g., model history view has it, change form doesn’t). Especially noticable in the breadcrumbs block.

What’s the impact? The breadcrumbs don’t render correctly?

Anyway, nice one spotting these, making a list, finding the exsisting issue, making this post, and any future issues/fixes you submit! Cheers!

---

<div class="post-metadata">

**Author:** ![Mah-Rye-Kuh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mah-rye-kuh/32/18416_2.png) [@Mah-Rye-Kuh](https://forum.djangoproject.com/u/Mah-Rye-Kuh)\
**Post date:** [September 21, 2026, 12:35pm UTC](https://forum.djangoproject.com/t/some-potential-bugs-found-when-making-custom-admin-pages/46049/4 "2026-09-21T12:35:59Z")

</div>

> [@adamchainz](#):
>
> What’s the impact? The breadcrumbs don’t render correctly?

It’s mostly an inconsistency that can break custom templates when copying from Django’s templates.

See the difference of these URLs to the model list view, usually the third breadcrumb item (search for `<a href="{% url opts|admin_urlname:'changelist' %}">`).

1. Object history template: `{{ module_name }}`.
2. Change form template: `{{ opts.verbose_name_plural|capfirst }}`.

---

<div class="post-metadata">

**Author:** ![Mah-Rye-Kuh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mah-rye-kuh/32/18416_2.png) [@Mah-Rye-Kuh](https://forum.djangoproject.com/u/Mah-Rye-Kuh)\
**Post date:** [October 5, 2026, 12:04pm UTC](https://forum.djangoproject.com/t/some-potential-bugs-found-when-making-custom-admin-pages/46049/5 "2026-10-05T12:04:13Z")

</div>

I created a ticket for the `module_name` issue: [#37399 (Include module\_name in all model admin views with breadcrumbs) – Django](https://code.djangoproject.com/ticket/37399).
