I'm new to Django, but the application that I have in mind might end up having URLs that look like this:

http://mysite/compare/id_1/id_2

Where "id_1" and "id_2" are identifiers of two distinct Model objects. In the handler for "compare" I'd like to asynchronously, and in parallel, query and retrieve objects id_1 and id_2.

Is there any way to do this using a standard Django syntax? I'm hoping for pseudocode that ends up looking something like this:

import django.async 

# Issue the model query, but set it up asynchronously.  
# The next 2 lines don't actually touch my database 
o1 = Object(id=id_1).async_fetch()
o2 = Object(id=id_2).async_fetch()

# Now that I know what I want to query, fire off a fetch to do them all
# in parallel, and wait for all queries to finish before proceeding. 

async.Execute((o2,o2))

# Now the code can use data from o1 and o2 below...
Edit
Report