Closed corneliusabel closed 1 year ago
This is why the display_transform
hook exists in the pivot function. Using str
fixes your issue, but I don't know that it is always the right thing to do, so you can call pivot this way:
pivot(Participant.objects.all(), 'language__name','languagelevel__level','id',Count, display_transform=str)
I'm going to close this issue. If the above suggestion to use display_transform
does not work for you, open a new issue.
First of all, thanks for the awesome package! Its really usefull!
I found a little bug in the pivot.py line 52. When i run pivot with the following parameters (models below):
I get the following error:
This can be fixed by explicitly casting strings as keys for the returned dictionary:
Should this be fixed in the code base or did I do something else wrong?
Best,
Cornelius
Relevant Models