73👍
✅
OrderNotes.objects.filter(item=item).values_list('shared_note', flat=True).distinct()
8👍
This is the best I came up with:
>>> items, item_ids = [], []
>>> for item in OrderNotes.objects.filter(shared_note=219):
... if item.shared_note not in item_ids:
... items.append(item)
... item_ids.append(item.shared_note)
- [Django]-Use django: from "python manage.py shell" to python script
- [Django]-Changing User ModelAdmin for Django admin
- [Django]-Do django db_index migrations run concurrently?
Source:stackexchange.com