I have two long lists of objects in Python: queries_list (list of Query objects) and results_list (list of Result objects)
I'd like find Result objects that are related to a Query, using a common field 'search_id', then I should append related results to Query.results list.
The pseudocode is as below:
for q in queries_list
for r in results_list
if q.search_id == r.search_id
q.results.append(r)