{"id":16292472,"url":"https://github.com/exogen/django-adminbrowse","last_synced_at":"2025-07-09T23:02:49.527Z","repository":{"id":1216036,"uuid":"1132608","full_name":"exogen/django-adminbrowse","owner":"exogen","description":"[UNMAINTAINED] Add related object links and other useful features to the Django admin interface.","archived":false,"fork":false,"pushed_at":"2016-09-20T03:51:39.000Z","size":99,"stargazers_count":39,"open_issues_count":9,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-30T22:30:28.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exogen.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":"2010-12-02T17:19:11.000Z","updated_at":"2024-04-23T13:01:08.000Z","dependencies_parsed_at":"2022-07-15T08:51:34.825Z","dependency_job_id":null,"html_url":"https://github.com/exogen/django-adminbrowse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/exogen/django-adminbrowse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fdjango-adminbrowse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fdjango-adminbrowse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fdjango-adminbrowse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fdjango-adminbrowse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exogen","download_url":"https://codeload.github.com/exogen/django-adminbrowse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exogen%2Fdjango-adminbrowse/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264504895,"owners_count":23618870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-10T20:06:54.162Z","updated_at":"2025-07-09T23:02:49.487Z","avatar_url":"https://github.com/exogen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-adminbrowse\n==================\n![Maintainers Wanted](https://img.shields.io/badge/maintainers-wanted-red.svg)\n\n\nMake browsing the Django admin site easier by adding helpful features to\nchangelist pages. Like so:\n\n![screenshot](http://exogen.github.com/django-adminbrowse/images/adminbrowse.png)\n\n* Link to the change form for objects in foreign key fields\n* Link to filtered changelist pages showing only related objects\n* Link to URLs contained in URL fields\n* Easily generate other dynamic changelist columns\n* Works with no modifications to Django or its default templates\n\nInstallation\n------------\nFrom the Python package index:\n\n    $ easy_install -Z django-adminbrowse\n\nThe `-Z` (`--always-unzip`) option will unzip the package during installation, making it easier to copy the media files to the desired location.\n\nFrom the source repository:\n\n    $ pip install git+git://github.com/exogen/django-adminbrowse.git\n\nThen, add 'adminbrowse' to your `INSTALLED_APPS`:\n\n    INSTALLED_APPS = (\n        ...\n        'adminbrowse',\n    )\n\nFinally, copy the media files to the location from which your static files\nare served, and set `ADMINBROWSE_MEDIA_URL` to the corresponding location.\nKeep reading for details.\n\nAfter installing adminbrowse, you may wish to ensure that everything's in\nworking order:\n\n    $ python manage.py test adminbrowse\n\nIf it's not, please let me know!\n\nUsage\n-----\n### Quickstart\nTo enable the most basic functionality, just inherit from\n`adminbrowse.AutoBrowseModelAdmin` instead of Django's\n`django.contrib.admin.ModelAdmin`:\n\n    from adminbrowse import AutoBrowseModelAdmin\n\n    class MyModelAdmin(AutoBrowseModelAdmin):\n        ...\n\nMake sure you have made adminbrowse media available at the URL specified by\nthe `ADMINBROWSE_MEDIA_URL` setting. For example, if you copied the \nadminbrowse media to **`\u003cMEDIA_ROOT\u003e/adminbrowse`**, set `ADMINBROWSE_MEDIA_URL`\nto **`\u003cMEDIA_URL\u003e/adminbrowse/`**.\n\n### How it works\nDjango allows one to use callable objects in the `list_display` attribute of\n`ModelAdmin` classes. adminbrowse is simply a collection of classes that\nimplement `__call__()` to dynamically render changelist column content.\n\nThe included `ModelAdmin` subclass, `AutoBrowseModelAdmin`, does only two\nthings:\n\n* It scans the `list_display` attribute when instantiated, replacing field\n  strings with their adminbrowse-enhanced equivalents when possible.\n* It includes the adminbrowse CSS in its Media definition.\n\nDocumentation\n-------------\n### Examples\nGiven these classes:\n\n    class Author(Model):\n        name = CharField(max_length=75)\n        website = URLField(blank=True)\n\n    class Book(Model):\n        title = CharField(max_length=200)\n        author = ForeignKey(Author, related_name='books')\n\n\n`Author`'s `ModelAdmin.list_display` might find these useful:\n\n* `link_to_url(Author, 'website')`: Make the author's URL clickable, if it exists\n* `link_to_changelist(Author, 'books')`: Link to a filtered `Book` changelist showing\n  only books for the appropriate author\n\nAnd `Book`'s `ModelAdmin.list_display` might want to use these:\n    \n* `truncated_field(Book, 'title', 50)`: Truncate long titles to 50 characters,\n  appending an ellipsis if needed\n* `link_to_change(Book, 'author')`: Link to the change form of the book's author\n\n### Media\nIf you're not using `AutoBrowseModelAdmin` to automatically include the adminbrowse\nmedia, you'll want to place the following `Media` definition in your `ModelAdmin`\nclasses:\n\n    class Media:\n        css = {'all': (ADMINBROWSE_MEDIA_URL + 'css/adminbrowse.css',)}\n\n...where `ADMINBROWSE_MEDIA_URL` is the value from `settings.py`.\n\n### Rendering templates\nUse `help(adminbrowse.template_column)` for now.\n\n### Custom changelist columns\nUse `help(adminbrowse.ChangeListColumn)` for now.\n\n### Performance effects\nWon't using `link_to_changelist()` drastically increase the number of queries\nexecuted? By default, yes, it will trigger one query per row in the changelist.\nThis trade-off may be acceptable, especially when you consider that the admin\nsite is paginated, and probably only accessed by a handful of people. In my\nexperience, the time spent on database queries is only increased by a few\nmilliseconds.\n\nHowever, if you can't spare the extra queries, you can still use\n`link_to_changelist()` in a useful way. The `text` argument sets the link text\nto display. If you set this to a string instead of a callable, the `QuerySet`\nwill never be evaluated (the default is `len()`, which is why the number of\nitems is shown – it's called with the `QuerySet`).\n\nUsing it like so:\n\n    link_to_changelist(Author, 'books', text=\"List books by this author\")\n\n...will still provide a clickable link to the filtered changelist without\nperforming the query.\n\n[INSTALL]: http://github.com/exogen/django-adminbrowse/blob/master/INSTALL\n[www]: http://brianbeck.com/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexogen%2Fdjango-adminbrowse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexogen%2Fdjango-adminbrowse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexogen%2Fdjango-adminbrowse/lists"}