https://github.com/pdrum/django_admin_links
A small tool for displaying foreign keys as read-only links in django admin
https://github.com/pdrum/django_admin_links
Last synced: about 1 year ago
JSON representation
A small tool for displaying foreign keys as read-only links in django admin
- Host: GitHub
- URL: https://github.com/pdrum/django_admin_links
- Owner: pdrum
- License: mit
- Created: 2017-11-03T14:02:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-03T14:50:37.000Z (over 8 years ago)
- Last Synced: 2024-03-14T15:12:29.584Z (over 2 years ago)
- Language: Python
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Django admin links
-------------------
### Installation
This package can be installed via pip using `pip install django_admin_links`
### Use
Django admin links is a tools using which you can
represent foreign keys as read-only links in django
admin in order to facilitate navigability.
In order to use this tool, you should let your django
admin classes inherit from `ModelAdminWithLinks` instead
of inheriting directly from `admin.ModelAdmin`. Similar
approach can be taken for `TabularInlineWithLinks` and
`StackedInlineWithLinks`. After doing that, you can define
a field on your admin class called `link_fields` and specify
names of the fields, you want to be represented as links in there.
It should be some iterable like a list or a tuple.
It is worth noting that fields included in `link_fields` should
also be included in `fields`.