1👍
✅
There can be multiple OrderItem
s for such customer. You filter with:
def test():
email = 'foo@bar.com'
customer_email = OrderItem.objects.filter(order__customer__email=email)
print(customer_email)
If you have an OrderItem
object you use:
myorderitem.order.customer.email
Source:stackexchange.com