{"id":13468542,"url":"https://github.com/gitaarik/django-admin-relation-links","last_synced_at":"2026-02-20T20:13:30.770Z","repository":{"id":57418818,"uuid":"86843633","full_name":"gitaarik/django-admin-relation-links","owner":"gitaarik","description":"An easy way to add links to relations in the Django Admin site.","archived":false,"fork":false,"pushed_at":"2020-12-03T18:43:06.000Z","size":65,"stargazers_count":108,"open_issues_count":5,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T11:52:30.409Z","etag":null,"topics":["django","django-admin"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/django-admin-relation-links","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitaarik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-31T17:22:03.000Z","updated_at":"2025-06-26T09:59:17.000Z","dependencies_parsed_at":"2022-09-13T13:20:30.630Z","dependency_job_id":null,"html_url":"https://github.com/gitaarik/django-admin-relation-links","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gitaarik/django-admin-relation-links","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitaarik%2Fdjango-admin-relation-links","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitaarik%2Fdjango-admin-relation-links/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitaarik%2Fdjango-admin-relation-links/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitaarik%2Fdjango-admin-relation-links/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitaarik","download_url":"https://codeload.github.com/gitaarik/django-admin-relation-links/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitaarik%2Fdjango-admin-relation-links/sbom","scorecard":{"id":427920,"data":{"date":"2025-08-11","repo":{"name":"github.com/gitaarik/django-admin-relation-links","commit":"286c59151c98902b29d6d600271b228c615bfdb6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 5/22 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE.txt:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: LICENCE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T02:39:02.486Z","repository_id":57418818,"created_at":"2025-08-19T02:39:02.486Z","updated_at":"2025-08-19T02:39:02.486Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29663014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-admin"],"created_at":"2024-07-31T15:01:13.135Z","updated_at":"2026-02-20T20:13:30.753Z","avatar_url":"https://github.com/gitaarik.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Django Admin relation links\n\nAn easy way to add links to relations in the Django Admin site.\n\n\n### Preview\n\nImagine you have admin pages for 2 models: `Member` and `Group`. `Member` has a `ForeignKey` relation to `Group`.\n\n- When you look at a member, you want to easily navigate to its group.\n- When you look at a group, you want to easily navigate to a list of the members in that group.\n\nWith the help of this app you can easily create these links:\n\n#### Member list page:\n![Member list page](https://raw.githubusercontent.com/gitaarik/django-admin-relation-links/master/screenshots/member-list-page.png)\n---------------------------\n\n#### Member change page:\n![Member change page](https://raw.githubusercontent.com/gitaarik/django-admin-relation-links/master/screenshots/member-change-page.png)\n---------------------------\n\n#### Group list page:\n![Member list page](https://raw.githubusercontent.com/gitaarik/django-admin-relation-links/master/screenshots/group-list-page.png)\n---------------------------\n\n#### Group change page:\n![Member change page](https://raw.githubusercontent.com/gitaarik/django-admin-relation-links/master/screenshots/group-change-page.png)\n\n\n### Install\n\n    pip install django-admin-relation-links\n\n\n### How to use\n\nThe links are placed on the *change page* of the model and go to the *change\nlist page* or the *change page* of the related model, depending on whether the\nrelated model has a `ForeignKey` to this model or this model has a `ForeignKey`\nto the related model, or if it's a `OneToOneField`.\n\nSo for example, if you have these models:\n\n\n```python\nfrom django.db import models\n\n\nclass Group(models.Model):\n    name = models.CharField(max_length=200)\n\n\nclass Member(models.Model):\n    name = models.CharField(max_length=200)\n    group = models.ForeignKey(Group, related_name='members')\n```\n\n\nThen in the admin you can add links on the `Group` *change page* to the\n`Member` *change list page* (all the members of that group) and on the `Member`\n*change page* a link to the `Group` *change page* (the group of that member).\nUse the `changelist_links` and `change_links` fields:\n\n```python\nfrom django.contrib import admin\nfrom django_admin_relation_links import AdminChangeLinksMixin\n\n\n@admin.register(Group)\nclass GroupAdmin(AdminChangeLinksMixin, admin.ModelAdmin):\n\n    list_display = ['name']\n\n    # Use the `related_name` of the `Member.group` field.\n    # If you have no `related_name` specified on your model, use the default\n    # `related_name` assigned by Django.\n    changelist_links = ['members']\n\n@admin.register(Member)\nclass MemberAdmin(AdminChangeLinksMixin, admin.ModelAdmin):\n    list_display = ['name']\n\n    # Here we just specify the name of the `ForeignKey` field.\n    change_links = ['group']\n```\n\n\n### List page links\n\nIt is possible to show links on admin *list page* as well, using the field `{field_name}_link`:\n\n```python\n@admin.register(Member)\nclass MemberAdmin(AdminChangeLinksMixin, admin.ModelAdmin):\n    list_display = ['name', 'group_link']  # Show link to group *change page* on member *list page*\n    change_links = ['group']\n```\n\n\n### Link label\n\nBy default, the label of the link is the string representation of the model\ninstance. You can change the label by creating a method named\n`{field_name}_link_label()` like this:\n\n```python\n    def group_link_label(self, group):\n        return '{} ({} members)'.format(\n            group.name,\n            group.members.count()\n        )\n```\n\n\n### Extra options\n\nYou can also set extra options like `label`, `model` and `lookup_filter` like this:\n\n```python\n@admin.register(Group)\nclass GroupAdmin(AdminChangeLinksMixin, admin.ModelAdmin):\n    list_display = ['name']\n    changelist_links = [\n        ('members', {\n            'label': 'All members',  # Used as label for the link\n            'model': 'Member',  # Specify a different model, you can also specify an app using `app.Member`\n            'lookup_filter': 'user_group'  # Specify the GET parameter used for filtering the queryset\n        })\n    ]\n```\n\n\n### List page ordering\n\nWhen showing links on the list page, when you use that field for ordering, the\ndefault ordering field is the first field in the `ordering` option on the\n`Meta` class of the model of the related field. You can specify an alternative\nordering like this:\n\n```python\n@admin.register(Group)\nclass MemberAdmin(AdminChangeLinksMixin, admin.ModelAdmin):\n    list_display = ['name', 'group_link']\n    change_links = [\n        ('group', {\n            'admin_order_field': 'group__name',  # Allow to sort members by `group_link` column\n        })\n    ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitaarik%2Fdjango-admin-relation-links","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitaarik%2Fdjango-admin-relation-links","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitaarik%2Fdjango-admin-relation-links/lists"}