This question has been flagged

I have two objects of model 'product.template' called 'things' and 'products'

things have product.template(29, 15, 14, 12, 11)

products have product.template(15, 29, 18, 10, 21, 12)

I want to make a third object of product.template having only common products in these two objects. ie,

third object prod should only have product.template(29, 15, 12)

Avatar
Discard
Author Best Answer

Found it myself. It's apparently


prod = products & things  #intersection

For More information on operations refer to this Recordset Operations
Avatar
Discard
Best Answer

third_object = []

for o_things in objects:

for o_prod in products:

if o_things.id == o_prod.id:

thrid_object.append(o_things.id)

Avatar
Discard