how to use connections.cursor() in Django Datatables View

Issue #32 resolved
mrumarasghar created an issue

In my scenario, I am going to use cursor queries just because of the my requirement is that in my case, we will not be known in advance that from which model we are going to get the data. All the models, fields, filters, sortings and groupby conditions will come dynamically selected by user from front-end, so which can't be established using django ORM so I have no other option except cursor queries.

So I got stuck at how to convert in converting cursor result to QuerySet which I need to return from filter_queryset function.

thanks

Regards Umar Asghar

Comments (4)

  1. Maciej Wisniowski repo owner

    Using Django ORM you're able to do filtering, ordering and group by so might be that you don't really need cursor queries. If it is really the case then you should possibly have a look at get_context_data method which is main method that calls filtering, ordering and paging methods. You can just override these using cursor queries and/or your own logic.

  2. mrumarasghar reporter

    ok thanks for your response. I am already doing it from the time I posted that issue ( not issue actually in my opinion it was the limitation of your outstanding module ) here.

    I would suggest to incorporate that part in your module. If you do so, it would get more usage in comparison with present. But the choice is yours.

    Regarding my case, I have done it through some other way but I get it done.

    By the ways, thanks for your efforts on this module. This is very helpful module.

    thanks

  3. Log in to comment