title: Django Admin foreign key, more detailed
body: <p>Im trying to customise my admin. I have a model with a foreign key to an another model. I currently have a dropdown that display a list of possible keys to chose from, but the list only shows the title. </p>
  
  <p>model.py</p>
  
  <pre><code>class Equipment(models.Model):
      noequipment = models.IntegerField('Equipment #' ,db_column='Noequipment', primary_key=True)  # Field name made lowercase.
      nom = models.CharField('Name',db_column='Nom', max_length=50, blank=True)  # Field name made lowercase.
      ...
      nooffice = models.ForeignKey('Office', db_column='NoOffice', blank=True, null=True, verbose_name='Office')  # Field name made lowercase.
      ...
  
      class Meta:
          db_table = 'equipment'
          ordering = ('nom',)
  
      def __str__(self):
          return self.nom
  
  
  class Office(models.Model):
      nooffice = models.IntegerField(db_column='NoOffice', primary_key=True)  # Field name made lowercase.
      officename = models.CharField(db_column='OfficeName', max_length=50, blank=True)  # Field name made lowercase.
      adresse = models.CharField(db_column='Adresse', max_length=50, blank=True)  # Field name made lowercase.
      ville = models.CharField(db_column='Ville', max_length=50, blank=True)  # Field name made lowercase.
      codepostal = models.CharField(db_column='CodePostal', max_length=50, blank=True)  # Field name made lowercase.
  
      class Meta:
          db_table = 'office'
  
      def __str__(self):
          return self.officename
  </code></pre>
  
  <p>All I need is that the admin would show a table with the attribute values on top of the drop down.</p>
  
  <p><a href="https://i.stack.imgur.com/0RhOu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0RhOu.png" alt="enter image description here"></a></p>
  
  <p>also here admin.py (Need special ModelAdmin because im using multiple DB as per <a href="https://docs.djangoproject.com/en/1.8/topics/db/multi-db/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.8/topics/db/multi-db/</a> )</p>
  
  <pre><code>from django.contrib import admin
  from .models import Equipment, Manufacturier, Office, Devicetype, Backdoor, Passage, Systadmin, Applicationadmin, Application, Os
  from django import forms
  from forms import EquipmentAdminForm, ManufacturierAdminForm, OfficeAdminForm, DevicetypeAdminForm, BackdoorAdminForm, PassageAdminForm, SystadminAdminForm, ApplicationadminAdminForm, ApplicationAdminForm, OsAdminForm
  
  class VCOEModelAdmin(admin.ModelAdmin):
  # A handy constant for the name of the alternate database.
      using = 'vcoe'
  
      def save_model(self, request, obj, form, change):
          # Tell Django to save objects to the 'other' database.
          obj.save(using=self.using)
  
      def delete_model(self, request, obj):
          # Tell Django to delete objects from the 'other' database
          obj.delete(using=self.using)
  
      def get_queryset(self, request):
          # Tell Django to look for objects on the 'other' database.
          return super(VCOEModelAdmin, self).get_queryset(request).using(self.using)
  
      def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
          # Tell Django to populate ForeignKey widgets using a query
          # on the 'other' database.
          return super(VCOEModelAdmin, self).formfield_for_foreignkey(db_field, request=request, using=self.using, **kwargs)
  
      def formfield_for_manytomany(self, db_field, request=None, **kwargs):
          # Tell Django to populate ManyToMany widgets using a query
          # on the 'other' database.
          return super(VCOEModelAdmin, self).formfield_for_manytomany(db_field, request=request, using=self.using, **kwargs)
  
  class VCOETabularInline(admin.TabularInline):
      using = 'vcoe'
  
      def get_queryset(self, request):
          # Tell Django to look for inline objects on the 'other' database.
          return super(VCOEMTabularInline, self).get_queryset(request).using(self.using)
  
      def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
          # Tell Django to populate ForeignKey widgets using a query
          # on the 'other' database.
          return super(VCOEMTabularInline, self).formfield_for_foreignkey(db_field, request=request, using=self.using, **kwargs)
  
      def formfield_for_manytomany(self, db_field, request=None, **kwargs):
          # Tell Django to populate ManyToMany widgets using a query
          # on the 'other' database.
          return super(VCOEMTabularInline, self).formfield_for_manytomany(db_field, request=request, using=self.using, **kwargs)
  
  class OfficeAdmin(VCOEModelAdmin):
      form = OfficeAdminForm
  
  class EquipmentAdmin(VCOEModelAdmin):
      form = EquipmentAdminForm
  
  ...
  
  admin.site.register(Equipment, EquipmentAdmin)
  ...
  admin.site.register(Office, OfficeAdmin)
  ...
  </code></pre>
  
  <p>and forms.py</p>
  
  <pre><code>from django import forms
  from .models import Equipment, Manufacturier, Office, Devicetype, Backdoor, Passage, Systadmin, Applicationadmin, Application, Os
  
  class EquipmentAdminForm(forms.ModelForm):
      class Meta:
          model = Equipment
          exclude = ['noequipment']
  
  ...
  
  class OfficeAdminForm(forms.ModelForm):
      class Meta:
          model = Office
          exclude = ['nooffice']
  </code></pre>