Changes between Initial Version and Version 1 of Ticket #23646


Ignore:
Timestamp:
Oct 13, 2014, 12:59:10 PM (10 years ago)
Author:
Brillgen Developers
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23646 – Description

    initial v1  
    33http://stackoverflow.com/questions/18797608/update-multiple-rows-in-same-query-using-postgresql
    44
     5Example:
     6Currently:
     7{{{
     8Books.objects.all().update(price=10)
     9}}}
     10
     11Proposed (syntax can vary):
     12{{{
     13Books.objects.all().update({'pk': 1, 'price': 10}, {'pk': 2, 'price': 25}])
     14}}}
     15
     16Idea is to do it in sql for performance reasons but still use the ORM and not use a raw database connection.
     17
    518However, 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
Back to Top