Closed P3RI9 closed 11 months ago
It's not clear to me what you're trying to accomplish. Unfortunately, when I do this suggestion:
When you change Grades.marks to a SmallIntegerField (in example) it works fine.
It does not work fine, I get an error that the field marks
expected a number but got b'Bilbao'
. Which makes sense, you can't store a string in an integer field. Also, these strings are unusual for "marks" which are usually numbers.
If I use a BinaryField
for marks and populate the data like this
marks = [[b'35', b'82'], [b'93', b'71']]
then the pivot table comes out fine. I can even add more marks for a student and see that the aggregations like Sum
and Avg
work. I'm not sure what you'd expect if you try to aggregate strings with Sum
or Avg
or if that is really your intended use case.
Hi! I have detected what I think is a bug with this library when using binary fields on a django model. The problem is that answers aren't shown right, just as 0.0 values Code to reproduce this bug: Models:
Code to fill models with django-shell
When you change Grades.marks to a SmallIntegerField (in example) it works fine. Could you help me?