wharton / drf-excel

An XLSX spreadsheet renderer for Django REST Framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example color field is not valid - should be row_color

nerjan opened this issue · comments

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

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