Skip to content

Instantly share code, notes, and snippets.

@shofetim
Created July 2, 2015 18:45
Show Gist options
  • Save shofetim/4da1fd7948455c14c948 to your computer and use it in GitHub Desktop.
Save shofetim/4da1fd7948455c14c948 to your computer and use it in GitHub Desktop.
from orders.constants import ORDER_STATUS_PLACED
sarahs = Vendor.objects.get(pk=38872)
ols = OrderLine.objects.filter(
order__order_status__lt=ORDER_STATUS_PLACED,
product__code__startswith='BB'
)
interesting = []
for ol in ols:
if sarahs in ol.product.piece.vendors:
interesting.append(ol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment