Skip to content

Commit

Permalink
Used get_value for custom column classes that override it
Browse files Browse the repository at this point in the history
  • Loading branch information
abdlrhman08 committed Apr 4, 2024
1 parent 370cfdf commit a43cf6b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions wagtail/admin/views/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,11 @@ def get_filename(self):

def to_row_dict(self, item):
"""Returns an OrderedDict (in the order given by list_export) of the exportable information for a model instance"""
list_accessors = [
field.accessor if isinstance(field, Column) else field
for field in self.list_export
]

row_dict = OrderedDict(
(field, multigetattr(item, field)) for field in list_accessors
(field, field.get_value(item))
if isinstance(field, Column)
else (field, multigetattr(item, field))
for field in self.list_export
)
return row_dict

Expand Down

2 comments on commit a43cf6b

@cyface
Copy link

@cyface cyface commented on a43cf6b Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that works!

@abdlrhman08
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great ! I opened a PR at #11834

Please sign in to comment.