kopia lustrzana https://github.com/jedie/PyInventory
Enhance change list filters by using RelatedOnlyFieldListFilter
rodzic
d6ec02cdc2
commit
b5899fcdbd
|
@ -167,13 +167,13 @@ To make a new release, do this:
|
|||
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)
|
||||
|
||||
* [**dev**](https://github.com/jedie/PyInventory/compare/v0.21.2...main)
|
||||
* 2025-09-21 - Update requirements
|
||||
* 2025-09-21 - Bugfix Memo changelist ordering
|
||||
* 2025-09-20 - Code cleanup: Use format_html() with kwargs
|
||||
* 2025-09-20 - Add type hints
|
||||
* 2025-09-20 - Cleanup: We didn't have make files
|
||||
* 2025-09-20 - Cleanup: Remove obsolete files
|
||||
* 2025-09-20 - Add PyCharm run configs
|
||||
* 2025-09-20 - Update requirements
|
||||
* 2025-09-20 - pre-commit: remove "default_install_hook_types"
|
||||
* 2025-09-20 - Remove obsolete config files
|
||||
* 2025-09-20 - Update ReadmeHistoryTestCase
|
||||
|
|
|
@ -49,7 +49,7 @@ class BaseUserAdmin(CompareVersionAdmin):
|
|||
if request.user.is_superuser:
|
||||
# Superuser sees entries from all users -> Add "By user" filter
|
||||
list_filter = list(list_filter)
|
||||
list_filter.insert(0, 'user')
|
||||
list_filter.insert(0, ('user', admin.RelatedOnlyFieldListFilter))
|
||||
|
||||
return list_filter
|
||||
|
||||
|
|
|
@ -94,7 +94,13 @@ class ItemModelAdmin(TagulousModelAdminFix, ImportExportMixin, SortableAdminMixi
|
|||
list_display = ('producer', 'item', 'kind', 'location', 'received_date', 'update_dt')
|
||||
ordering = ('path_str',)
|
||||
list_display_links = ()
|
||||
list_filter = (LimitTreeDepthListFilter, 'kind', 'location', 'producer', 'tags')
|
||||
list_filter = (
|
||||
LimitTreeDepthListFilter,
|
||||
('kind', admin.RelatedOnlyFieldListFilter),
|
||||
('location', admin.RelatedOnlyFieldListFilter),
|
||||
('producer', admin.RelatedOnlyFieldListFilter),
|
||||
('tags', admin.RelatedOnlyFieldListFilter),
|
||||
)
|
||||
search_fields = ('name', 'description', 'kind__name', 'tags__name')
|
||||
fieldsets = (
|
||||
(
|
||||
|
|
|
@ -44,7 +44,7 @@ class MemoModelAdmin(TagulousModelAdminFix, ImportExportMixin, SortableAdminBase
|
|||
list_display = ('name', 'update_dt')
|
||||
ordering = ('-update_dt',)
|
||||
list_display_links = ('name',)
|
||||
list_filter = ('tags',)
|
||||
list_filter = (('tags', admin.RelatedOnlyFieldListFilter),)
|
||||
search_fields = ('name', 'memo', 'tags__name')
|
||||
fieldsets = (
|
||||
(
|
||||
|
|
Ładowanie…
Reference in New Issue