8👍
✅
Here –
items = Item.objects.filter(customer_items__customer=customer, customer_items__item_count__gt = 0)
As you’ve added related_name='customer_items'
to the Item
foreign-key. You can access the CustomerItem
related to any Item
via item.customer_items
. Rest is piece of cake.
- [Django]-Fake subfunction in django UnitTest Case (Mocking)
- [Django]-Django & Nginx deeplinking domains (re-write rules or django urls?)
- [Django]-Django compressor fails to find any `compress` tags
- [Django]-Front-end prototype/skeleton in Django
- [Django]-Getting Django's staticfiles includes working inside Vue.js .vue templates
Source:stackexchange.com