Message info
 
To: From:Django Subject:Re: [Django] #18285: bulk_create and ManyToMany relationships: the relationship is actually not made Date:Mon, 07 May 2012 21:10:08 -0000
 

#18285: bulk_create and ManyToMany relationships: the relationship is actually not
made
-------------------------------------+-------------------------------------
Reporter: Michael PALUMBO | Owner: nobody
<michael.palumbo87@> | Status: new
Type: Bug | Version: 1.4
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: bulk_create, | Patch needs improvement: 0
relationship | UI/UX: 0
Has patch: 0 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by akaariai):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

I quickly checked the related fields for .create() support and both
reverse foreign key and m2m field has support for create.

I think my current approach would be to add bulk_create() support for
reverse foreign key (as it is somewhat easy to do so), and just raise
!NotImplemented from m2m.bulk_create(). Fixing the m2m bulk_create would
require support for returning the primary key value from bulk_insert to
create the links, and that support is not currently available (and is not
going to be available in the foreseeable future).

In addition generic relations need a check for this, too.

--
Ticket URL: <https://code.djangoproject.com/ticket/18285#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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.