Your approach is a bit flawed. You have several different options.
The first, probably the easiest, is to use AJAX and HTTPRequest. Have a series of them, each of which leads to one Table.objects.filter(someObjectForFilter[i]). . Upon completion of each of them, the script completes and returns the results to the client. The client updates the user interface and initiates the next request with another AJAX call.
Another method is to use a batch system. This is a bit heavier, but probably a better design if you go for a real "heavy lift" in the database. You will need to run a batch daemon (this requires a simple cron probe) to scan incoming tasks. The user wants to accomplish something, so their request sends this task (it could just be a row in the database with their parameters). The daemon captures it, processes it completely autonomously - perhaps even on another machine - and updates the task line when it ends with the results. The client can then be updated periodically to check the status of this line using traditional or AJAX methods.
Tyson source share