Is there a way to simplify this Django query?
- by Mark
accepted_bids = Bid.objects.filter(shipment__user=u, status='acc').select_related('shipment')
completed_shipments = []
for b in accepted_bids:
completed_shipments.append(b.shipment)
vehicles_shipped = []
for s in completed_shipments:
vehicles_shipped.extend(s.items.all())
In the end, I want a list of shipped vehicles. A vehicle is shipped…