# Hide Admin panel drop down

**URL:** <https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432>\
**Category:** The Admin\
**Created:** [July 31, 2024, 6:12am UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432 "2024-07-31T06:12:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohit2305](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mohit2305/32/22950_2.png) [@mohit2305](https://forum.djangoproject.com/u/mohit2305)\
**Post date:** [July 31, 2024, 6:12am UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432/1 "2024-07-31T06:12:47Z")

</div>

I have created a Django project with two tables: `factors` and `version_composition`. In the `version_composition` table, `factor` is used as a foreign key. I have used the tabular method to create an admin panel for `factor` and included it in `version_composition`. This creates a dropdown, but I want to hide this dropdown. Is there any method or example to achieve this?

---

<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:** [July 31, 2024, 12:09pm UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432/2 "2024-07-31T12:09:58Z")

</div>

Welcome @mohit2305 !

I understand that English is probably not your primary language, but I think you’re going to need to try rewording your question for us to be able to help you.

If you’re more comfortable writing in your native language, you can try writing your post in that language, and then using something like Google translate to convert it to English.

---

<div class="post-metadata">

**Author:** ![mohit2305](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mohit2305/32/22950_2.png) [@mohit2305](https://forum.djangoproject.com/u/mohit2305)\
**Post date:** [August 1, 2024, 4:39am UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432/3 "2024-08-01T04:39:21Z")

</div>

Hello sir,

@KenWhitesell, please read it.

Thank you

---

<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:** [August 1, 2024, 4:48am UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432/4 "2024-08-01T04:48:00Z")

</div>

I’m still not sure I’m understanding what you’re looking for.

If you don’t want to see the `factor` field in `version_composition`, then don’t include that field in the model’s [fields attribute](https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.fields) in the ModelAdmin class.

But, what you wrote leads me to believe you’re using a [TabularInline](https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.TabularInline) to show these instances, I’m not understanding why you’re doing this and then not wanting to show it.

---

<div class="post-metadata">

**Author:** ![mohit2305](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mohit2305/32/22950_2.png) [@mohit2305](https://forum.djangoproject.com/u/mohit2305)\
**Post date:** [August 1, 2024, 4:53am UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432/5 "2024-08-01T04:53:27Z")

</div>

Hello @KenWhitesell

We want to ensure that the data already stored in the `factor` table should not be selectable, but the ‘Add’ option should still appear. In the tabular method, the data we add should automatically be selected in `version_composition`.

---

<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:** [August 1, 2024, 5:15am UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432/6 "2024-08-01T05:15:24Z")

</div>

If what you’re looking to do is to not display existing entries, then you could create a custom [get\_queryset()](https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_queryset) method on your inline to not return any entries.

At this point, to provide any further assistance, I think I’m going to need to see these models and their model admin classes.

---

<div class="post-metadata">

**Author:** ![mohit2305](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mohit2305/32/22950_2.png) [@mohit2305](https://forum.djangoproject.com/u/mohit2305)\
**Post date:** [August 1, 2024, 6:40am UTC](https://forum.djangoproject.com/t/hide-admin-panel-drop-down/33432/7 "2024-08-01T06:40:42Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/3/d/3d8314429be7261950d7104de7473965155fdb20.png)

@KenWhitesell In this image, the dropdown data comes from the `factor` table, but we want to hide this dropdown. However, we want the ‘Add’ and ‘Edit’ options to work as it.
