#17465: Multiple INSERT RETURNING
-------------------------------------+-------------------------------------
     Reporter:  alexandr.s.rus@…     |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:
  (models, ORM)                      |  1.4-alpha-1
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  db, orm, insert,     |             Triage Stage:
  django models                      |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by russellm):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => wontfix
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 As with all proposed feature additions, my question is Why?

 What is the use case for this feature? Your example code shows a bunch of
 insertions of new objects -- why doesn't the basic Django pattern of just
 accessing the attribute of the object you just inserted work here?

 Django's ORM doesn't currently expose the return value of INSERT calls --
 they're returned implicitly. Why should Django's ORM provide access to
 INSERT return values? And given that you can access the inserted value
 using the attributes on the inserted object, why should we add a second
 way to access the inserted value?

 Remember, Django's ORM isn't an attempt to be a 100% match for SQL syntax.
 It's an attempt to make a slightly more object-like layer around SQL
 syntax. If you have an esoteric use case, it's entirely possible  that the
 fix lies in using SQL directly, rather than in trying to munge Django's
 ORM to be more SQL-like.

 Marking wontfix, because no use case is provided, and while 2 syntaxes
 have been proposed, there's no explanation of how this maps onto actual
 usage in practice. If you want to defend this proposed feature, please
 take it up on the django-developers mailing list.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17465#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to