RamezIssac/django-slick-reporting

Allowing ReportGeneratorAPI.group_by to have multiple fields

oaaoaa opened this issue · 3 comments

oaaoaa commented

Currently there is a restriction on group_by to be a single field. Why not allow it to be a list of fields just like ReportGeneratorAPI.columns? Many times we have to group by on multiple db columns.

Won't fix.
Having multiple group by column will add huge layer of extra complexity.

You can create a database view where you concat the values of the different group by fields into one field and then use that with Slick Reporting.

oaaoaa commented

OK. Then can you please allow group by on an annotated field. Currently it is not allowed. Need to add annotated field to the list of types of field in check_column etc. as I had suggested in #68 (comment) and
#68 (comment)

Then we will not need to create a separate DB view and can just do that with annotation.

I dont see myself working on the group by on annotation soon.
So, Submit a PR for it and i will check it, if it passes i will gladly integrate it.
Or you might be interested in professinaly supporting the package in which case let's discuss over the email.