1π
Have you tried converting itertools.chain
to a list:
queryset = list(chain(jobdtlquery, jobmstquery))
Update You can concatenate the queries on the same model like this:
queryset = query1 | query2
Update As the error message implies, your queryset has to have only one model
. You cannot achieve your goal with two different models.
This question seems like a dublicate.
0π
Because a ResourceModel is made to allow a REST client to make queries that filter, paginate and sort, which then trigger the appropriate SQL query, itβs not possible to just use an iterator which cannot be as flexible.
Maybe you can hack something that works but looks like the cleanest stuff is to use a plain Resource and add your own logic. See this answer Tastypie: How can I fill the resource without database? which refers to Resource VS ModelResource in the documentation http://django-tastypie.readthedocs.org/en/latest/resources.html#why-resource-vs-modelresource
- [Answer]-Django β AttributeError β 'unicode' object has no attribute 'META'
- [Answer]-Angular route won't load templateUrl
- [Answer]-Django Assign Value To Model Form Before Validate
- [Answer]-Django β redirect another client to a specific page
- [Answer]-Django social auth in existing project