Version: drop file field, use files instead #193

Merged
Oleg-Komarov merged 6 commits from version-drop-file into main 2024-06-21 11:29:22 +02:00
Showing only changes of commit 29fdab5495 - Show all commits

View File

@ -76,7 +76,7 @@ class FileAdmin(admin.ModelAdmin):
'date_created', 'date_created',
'date_modified', 'date_modified',
'date_status_changed', 'date_status_changed',
'versionfiles__version', ('version', admin.EmptyFieldListFilter),
('icon_of', admin.EmptyFieldListFilter), ('icon_of', admin.EmptyFieldListFilter),
('featured_image_of', admin.EmptyFieldListFilter), ('featured_image_of', admin.EmptyFieldListFilter),
('preview', admin.EmptyFieldListFilter), ('preview', admin.EmptyFieldListFilter),
@ -87,7 +87,7 @@ class FileAdmin(admin.ModelAdmin):
'date_created', 'date_created',
'type', 'type',
'status', 'status',
link_to('versionfiles__version', 'version of'), link_to('version', 'version of'),
link_to('icon_of'), link_to('icon_of'),
link_to('featured_image_of'), link_to('featured_image_of'),
link_to('preview_set.extension', 'preview of'), link_to('preview_set.extension', 'preview of'),
@ -95,16 +95,15 @@ class FileAdmin(admin.ModelAdmin):
) )
list_select_related = ( list_select_related = (
'versionfiles__version__extension',
'user', 'user',
'versionfiles__version',
'validation', 'validation',
) )
list_prefetch_related = ( list_prefetch_related = (
'icon_of', 'icon_of',
'featured_image_of', 'featured_image_of',
'preview_set__extension', 'preview_set__extension',
'versionfiles__version', 'version',
'version__extension',
) )
autocomplete_fields = ['user'] autocomplete_fields = ['user']