django-pivot
                                
                                 django-pivot copied to clipboard
                                
                                    django-pivot copied to clipboard
                            
                            
                            
                        Pivot on Union Queryset : Calling QuerySet.distinct() after union() is not supported.
Hi there,
I'm trying to get some dashboarded datas on some models, and even between models.
issue description : When I union 2 queryset of models objects, and then try to pivot with pivot_table, I've got the issue :
django.db.utils.NotSupportedError: Calling QuerySet.distinct() after union() is not supported.
Step to reproduce :
- define a model
- add some new instances
- : a=models.MYModel.objects.filter(pk=1) b=models.MYModel.objects.filter(pk=2) c=a.union(b) pivot_table = pivot(c, 'field1', 'field2', 'field3')
=> raise the error above
is there anything I missed ?
infos : django v4.1.2 python v3.9.2 django-pivot v1.9.0