Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Allow foreign key attributes in list_display with '__'

Project Description

Allow foreign key attributes in list_display with ‘__’

This is based on DjangoSnippet 2996 which was made by Kpacn.


  1. This library is on PyPI so you can install it with:

    pip install django-related-admin

or from github:

pip install git+
  1. Add “related_admin” to your INSTALLED_APPS setting like this:



Just use it instead of model.Admin:

from related_admin import RelatedFieldAdmin
from related_admin import getter_for_related_field

class FooAdmin(RelatedFieldAdmin):
    # these fields will work automatically (and boolean fields will display an icon):
    list_display = ('address__phone','address__country__country_code','address__foo')

    # ... but you can also define them manually if you need to override short_description or boolean parameter:
    address__foo = getter_for_related_field('address__foo', short_description='Custom Name', boolean=True)

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(8.4 kB) Copy SHA256 Hash SHA256
Source None Apr 24, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting