django-commons / drf-excel

An XLSX spreadsheet renderer for Django REST Framework.
BSD 3-Clause "New" or "Revised" License
217 stars 40 forks source link

Example color field is not valid - should be row_color #69

Closed nerjan closed 1 year ago

nerjan commented 1 year ago
class ExampleSerializer(serializers.Serializer):
    color = serializers.SerializerMethodField()

    def get_color(self, instance):
        color_map = {'w': 'FFFFFFCC', 'a': 'FFFFCCCC'}
        return color_map.get(instance.alarm_level, 'FFFFFFFF')

This class from example should have "color" changed to "row_color", as described here https://stackoverflow.com/questions/57709727/drf-formatting-xlsx-content

FlipperPA commented 1 year ago

I've updated this in the Configuring Styles section. Thanks for the catch, @nerjan!