Merging or joining raw query set results.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Merging or joining raw query set results.


I have a raw query which takes in 4 ids within a for loop. It therefore returns 4 query set results.

I put the result of each query set into a dictionary and append it to a list.
The result looks something like this:

[{'first_name': u'John'}, {'first_name': u'Jack'}, {'first_name': u'Jill'}]
[ ]
[{'first_name': u'James'}, {'first_name': u'Phil'}]
[{'first_name': u'Bill'}]

I'm trying to merge the query set results into one list to get something like
[{'first_name': u'John'}, {'first_name': u'Jack'}, {'first_name': u'Jill'}, {'first_name': u'James'}, {'first_name': u'Phil'}, {'first_name': u'Bill'}]

Any help will be appreciated. 

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 [hidden email].
To view this discussion on the web visit