Changes between Initial Version and Version 1 of Ticket #23646
- Timestamp:
- Oct 13, 2014, 12:59:10 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23646 – Description
initial v1 3 3 http://stackoverflow.com/questions/18797608/update-multiple-rows-in-same-query-using-postgresql 4 4 5 Example: 6 Currently: 7 {{{ 8 Books.objects.all().update(price=10) 9 }}} 10 11 Proposed (syntax can vary): 12 {{{ 13 Books.objects.all().update({'pk': 1, 'price': 10}, {'pk': 2, 'price': 25}]) 14 }}} 15 16 Idea is to do it in sql for performance reasons but still use the ORM and not use a raw database connection. 17 5 18 However, such an interface is not exposed via the Django ORM. Would this be accepted as a patch? if so, would a list dictionary with the various fields:values to be updated be a good way to provide the input to ORM