Allow foreign key attributes in list_display with '__'
Project description
====================
django-related-admin
====================
Allow foreign key attributes in list_display with '__'
This is based on (DjangoSnippet 2996)[https://djangosnippets.org/snippets/2996/] which was made by Kpacn.
Installation
------------
Installation
-----------
1. This library is on PyPI so you can install it with::
pip install django-related-admin
or from github::
pip install git+https://github.com/PetrDlouhy/django-related-admin#egg=django-related-admin
2. Add "polls" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'related_admin',
)
Usage
-----
from related_admin import RelatedFieldAdmin
class FooAdmin(RelatedFieldAdmin):
# these fields will work automatically:
list_display = ('address__phone','address__country__country_code','address__foo')
# ... but you can also define them manually if you need to override short_description:
address__foo = getter_for_related_field('address__foo', short_description='Custom Name')
django-related-admin
====================
Allow foreign key attributes in list_display with '__'
This is based on (DjangoSnippet 2996)[https://djangosnippets.org/snippets/2996/] which was made by Kpacn.
Installation
------------
Installation
-----------
1. This library is on PyPI so you can install it with::
pip install django-related-admin
or from github::
pip install git+https://github.com/PetrDlouhy/django-related-admin#egg=django-related-admin
2. Add "polls" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'related_admin',
)
Usage
-----
from related_admin import RelatedFieldAdmin
class FooAdmin(RelatedFieldAdmin):
# these fields will work automatically:
list_display = ('address__phone','address__country__country_code','address__foo')
# ... but you can also define them manually if you need to override short_description:
address__foo = getter_for_related_field('address__foo', short_description='Custom Name')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-related-admin-0.2.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00d8c7eb3b2465c3e46fd0017bd5ea081bf64a6d1ce741260ac71db89b808556 |
|
MD5 | ba094188b89b3ee83d782a318bc231e2 |
|
BLAKE2b-256 | 231f7dc555f2a6f57a51f3ad463be0225eff45c69952d4b577258e1620e3e2a8 |