You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, for situations where we need to use a wagtail.admin.ui.tables.Column object in the list_display property of a SnippetViewSet, we often need to use that same Column in the list_export.
But today SnippetViewSets don't support Column objects in list_export, only in list_display. So we are unable to make the export match the display.
Describe the solution you'd like
Support using wagtail.admin.ui.tables.Column objects in list_export for SnippetViewSets.
Describe alternatives you've considered
Custom list_export handler class.
Monkey patching
Additional context
Today in a SnippetViewSet for Tags, if we want to include things like number of pages and images that use that tag, we have a Column class that does that calculation. We used to have a method directly on the ModelViewSet, but that stopped working when we converted to SnippetViewSets. So now we use a pair of Column objects to handle those calculations.
On a typical Model, you could just add the methods to the Model itself, but we don't control the Tag model, since it's owned by taggit. Hence why we originally had the methods on the ModelViewSet, and now in Column objects.
The text was updated successfully, but these errors were encountered:
Is your proposal related to a problem?
Currently, for situations where we need to use a
wagtail.admin.ui.tables.Column
object in thelist_display
property of a SnippetViewSet, we often need to use that same Column in thelist_export
.But today SnippetViewSets don't support Column objects in
list_export
, only inlist_display
. So we are unable to make the export match the display.Describe the solution you'd like
Support using
wagtail.admin.ui.tables.Column
objects inlist_export
for SnippetViewSets.Describe alternatives you've considered
list_export
handler class.Additional context
Today in a SnippetViewSet for Tags, if we want to include things like number of pages and images that use that tag, we have a Column class that does that calculation. We used to have a method directly on the ModelViewSet, but that stopped working when we converted to SnippetViewSets. So now we use a pair of Column objects to handle those calculations.
On a typical Model, you could just add the methods to the Model itself, but we don't control the Tag model, since it's owned by
taggit
. Hence why we originally had the methods on the ModelViewSet, and now in Column objects.The text was updated successfully, but these errors were encountered: