Re: [Django] #23646: query set sql update to change different values by different keys (include django-bulk-update in core)

2018-02-13 Thread Django
#23646: query set sql update to change different values by different keys 
(include
django-bulk-update in core)
-+-
 Reporter:  Brillgen Developers  |Owner:  Tom
 |  Forbes
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tom Forbes):

 * cc: Tom Forbes (added)
 * owner:  nobody => Tom Forbes
 * status:  new => assigned


Comment:

 Sorry for the duplicate, I'm not sure how my search missed this. I've got
 a patch that implements this at a basic level, there are some small
 optimizations that could be done at a later stage (including adding
 Postgres specific syntax).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e1b4eaf69897dbcee774bd04d7595dac%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23646: query set sql update to change different values by different keys (include django-bulk-update in core)

2018-02-13 Thread Django
#23646: query set sql update to change different values by different keys 
(include
django-bulk-update in core)
-+-
 Reporter:  Brillgen Developers  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * has_patch:  0 => 1


Comment:

 #29037 is a duplicate with [https://github.com/django/django/pull/9606 a
 patch].

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.825a24b1d953cb27765e99f4a09de16f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23646: query set sql update to change different values by different keys (include django-bulk-update in core)

2016-05-12 Thread Django
#23646: query set sql update to change different values by different keys 
(include
django-bulk-update in core)
-+-
 Reporter:  brillgen |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * stage:  Unreviewed => Accepted


Comment:

 Tentatively accepting, pending discussion on the DevelopersMailingList to
 approve the idea and API.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.b3eef482fbdbadde6688edec389a8525%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23646: query set sql update to change different values by different keys (include django-bulk-update in core) (was: query set sql update to change different values by different keys)

2016-05-11 Thread Django
#23646: query set sql update to change different values by different keys 
(include
django-bulk-update in core)
-+-
 Reporter:  brillgen |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by brillgen):

 * version:  1.7 => 1.9


Old description:

> Database backends like Postgresql support doing multiple value update for
> the same field in different rows using a single update query. Please see
> this sample below:
>
> http://stackoverflow.com/questions/18797608/update-multiple-rows-in-same-
> query-using-postgresql
>
> Example:
> Currently:
> {{{
> Books.objects.all().update(price=10)
> }}}
>
> Proposed (syntax can vary):
> {{{
> Books.objects.all().update({'pk': 1, 'price': 10}, {'pk': 2, 'price':
> 25}])
> }}}
>
> Idea is to do it in sql for performance reasons but still use the ORM and
> not use a raw database connection.
>
> 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

New description:

 **Update**
 django-bulk-upate (​https://github.com/aykut/django-bulk-update) which
 could/should be integrated into django core since we have a bulk_create
 and this corresponds well with the save (could be called bulk save if it
 makes sense). App works with an identical api to bulk_create and so should
 be a good candidate to be considered for inclusion in core.

 Database backends like Postgresql support doing multiple value update for
 the same field in different rows using a single update query. Please see
 this sample below:

 http://stackoverflow.com/questions/18797608/update-multiple-rows-in-same-
 query-using-postgresql

 Example:
 Currently:
 {{{
 Books.objects.all().update(price=10)
 }}}

 Proposed (syntax can vary):
 {{{
 Books.objects.all().update({'pk': 1, 'price': 10}, {'pk': 2, 'price':
 25}])
 }}}

 Idea is to do it in sql for performance reasons but still use the ORM and
 not use a raw database connection.

 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

--

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.46e7abd6cdc4c3f98b10ed97743ca264%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.