RamezIssac / django-slick-reporting

The Reporting Engine for Django. Create dashboards and standalone Reports and Charts.

Home Page:https://django-slick-reporting.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant use SlickReportField for FloatField

nquang2448 opened this issue · comments

i try use SlickReportView and in
columns = [
SlickReportField.create(method = Sum, field= 'balance', name='sum__balance'),
]

  • field balance is FloatField. They have error :

Exception Type: | KeyError
Exception Value: | 'balance__sum'

Screen Shot 2021-01-14 at 18 28 38

Can you attach your whole view ?
Looks to me that there is a typo though... in the columns you're showing it is 'sum__balance'.. however the error value you reported cit complains about `balance__sum'

Also: Changing the Decimal Fields to Floats in the tests suits does NOT produce any errors :)

Can you attach your whole view ?
Looks to me that there is a typo though... in the columns you're showing it is 'sum__balance'.. however the error value you reported cit complains about `balance__sum'

Also: Changing the Decimal Fields to Floats in the tests suits does NOT produce any errors :)

I try find your trouple in your code. I find a line in helpers.py
return ''.join([calculation_field.lower(), calculation_method.name.lower()])
if my field is : balanceValue
it will return : balancevalue__sum instead of balanceValue__sum
So that's make me have a error.
i try fix it to :
return '
'.join([calculation_field, calculation_method.name.lower()])
-> it's solved
Also thank you when you created SlickReportField