Re: [Django] #29211: update_or_create with column named defaults

2018-03-12 Thread Django
#29211: update_or_create with column named defaults
-+-
 Reporter:  James Pic|Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  2.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  wontfix
 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 Jani Tiainen):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 {{{update_or_create()}}} uses same parameters as {{{get_or_create()}}},
 and from the {{{get_or_create()}}} docs:

 > If you have a field named defaults and want to use it as an exact lookup
 in {{{get_or_create()}}}, just use {{{'defaults__exact'}}}, like so:
 > {{{#!python
 > Foo.objects.get_or_create(defaults__exact='bar', defaults={'defaults':
 'baz'})
 > }}}

 Closing as won't fix.

-- 
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/062.f5e88deb68f8e62c3c19202c359949f6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #29211: update_or_create with column named defaults

2018-03-12 Thread Django
#29211: update_or_create with column named defaults
-+-
   Reporter:  James Pic  |  Owner:  nobody
   Type:  New| Status:  new
  feature|
  Component:  Database   |Version:  2.0
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Currently, signature is: update_or_create(defaults=None, **kwargs)

 This means that it's not possible to with a column named "defaults".

 Perhaps it would be better to accept a dict in args, since we reserve
 kwargs for column names ?

-- 
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/047.309be1eb7b56eb8810c7bcf3ab8454dc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.