# Django admin model form dropdown value instead of Object

**URL:** <https://forum.djangoproject.com/t/django-admin-model-form-dropdown-value-instead-of-object/17756>\
**Category:** Forms & APIs\
**Created:** [December 21, 2022, 9:57am UTC](https://forum.djangoproject.com/t/django-admin-model-form-dropdown-value-instead-of-object/17756 "2022-12-21T09:57:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameshkrr](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/rameshkrr/32/11399_2.png) [@rameshkrr](https://forum.djangoproject.com/u/rameshkrr)\
**Post date:** [December 21, 2022, 9:57am UTC](https://forum.djangoproject.com/t/django-admin-model-form-dropdown-value-instead-of-object/17756/1 "2022-12-21T09:57:56Z")

</div>

my admin.py

```auto
from django.contrib import admin
from . import models
from django.contrib.auth.models import Group, User
from .models import Product
from .forms import ForumForm

class ForumArea(admin.AdminSite):
    site_header = "User Forums"

class ForumLists(admin.ModelAdmin):
    list_display = ['id','sno','customer_name','date','weight','touch','percent','owner', 'product_data']    
    list_per_page = 20
    list_filter = ['sno','customer_name','date']
    search_fields = ['sno','customer_name','date']
    form = ForumForm
    def owner(self, obj):
         subject_object = User.objects.get(id=obj.id)
         return str(subject_object)
     
    def product_data(self, obj):
         subject_object = Product.objects.get(id=obj.id).name
         return str(subject_object)

    fieldsets = (
            (("Basic Details"), {"fields": ("sno", "user", "customer_name", "date")}),
            (
                ("Touch Details"),
                {
                    "fields": (
                        "touch","percent","weight","product_type"
                    ),
                },
            ),
            )
    
forum_site = ForumArea(name="ForumSite")

forum_site.register(models.forum,ForumLists)

```

My form.py

```auto
from django import forms
from django.forms import ModelChoiceField
from .models import *
    
class ForumForm(forms.ModelForm):
    
    

    def __init__ (self, *args, **kwargs):
        super(). __init__ (*args, **kwargs)
        product_type = forms.ModelChoiceField(queryset=Product.objects.all())

    class Meta:
        fields = ('id','sno', 'user', 'customer_name', 'date', 'product_type', 'weight', 'touch', 'paisa', 'percent', 'mark')

```

The foreign key dropdown for product\_key is showing “Product Object(1)” value I need to show it’s object value like name instead of object. I’m new to django please support.

---

<div class="post-metadata">

**Author:** ![leandrodesouzadev](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/leandrodesouzadev/32/8981_2.png) [@leandrodesouzadev](https://forum.djangoproject.com/u/leandrodesouzadev)\
**Post date:** [December 21, 2022, 10:50am UTC](https://forum.djangoproject.com/t/django-admin-model-form-dropdown-value-instead-of-object/17756/2 "2022-12-21T10:50:58Z")

</div>

> [@rameshkrr](#):
>
> ```auto
> product_type = forms.ModelChoiceField(queryset=Product.objects.all())
> 
> ```

You’re using `ModelChoiceField`, from the `forms` module.  
Searching for `forms` on the docs, on the API Reference there’s [this topic](https://docs.djangoproject.com/en/4.1/ref/forms/fields/#modelchoicefield) about `ModelChoiceField`.  
Read this section.
