union in get_initial_queryset in datatable

32 views
Skip to first unread message

Rajshree Some

unread,
Jun 29, 2020, 10:13:07 AM6/29/20
to Django users
list=Model1.objects.filter(
             reservation__in=Model.objects.filter(resource__in=resources).union(
            Model2.objects.filter(
     reservation__in=Model.object.filter(resource__in=resources).defer('col4','col5','col6'), 
             Model3.objects.filter(
                 reservation__in=Model.objects.filter(resource__in=resources),\
            Model4.objects.filter(
                 reservation__in=Model.objects.filter(resource__in=resources).defer('col4')

I am trying to resturn this queryset in get_initial_queryset in datatable.But getting an error 

raise DatabaseError('ORDER BY term does not match any column in the result set.')

Akinfolarin Stephen

unread,
Jun 29, 2020, 4:55:25 PM6/29/20
to django...@googlegroups.com
sorry don't get you can you be more clear with your error

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/454e3bec-accf-4bb5-9eb5-1a0c833a4527o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages