for k, v in groupby(order.proposal.proposal_products, key=lambda prod_cp: prod_cp.request_product_id):
lv = list(v)
print(type(k), k, lv)
<class 'int'> 25 [<ProposalProduct 11>]
<class 'int'> 28 [<ProposalProduct 12>]
<class 'int'> 24 [<ProposalProduct 10>]
<class 'int'> 28 [<ProposalProduct 14>]