Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2014-02-14 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
-+-
 Reporter:  rogerhu  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.6
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by Tim Graham ):

 In [changeset:"a6f05af016b5488b42b9334ec915d6dfd2702c00"]:
 {{{
 #!CommitTicketReference repository=""
 revision="a6f05af016b5488b42b9334ec915d6dfd2702c00"
 [1.6.x] Added 1.6.3 release note for refs #21566.

 Backport of 865392c478 from master
 }}}

-- 
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/065.c41f413a3c6087b10bf0c085b24e6530%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2014-02-14 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
-+-
 Reporter:  rogerhu  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.6
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by Tim Graham ):

 In [changeset:"865392c47899d70229d2450ec398582f31e3cf1d"]:
 {{{
 #!CommitTicketReference repository=""
 revision="865392c47899d70229d2450ec398582f31e3cf1d"
 Added 1.6.3 release note for refs #21566.
 }}}

-- 
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/065.c9cdc1f38c6f547d7a37c9f638d0c7d9%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2014-02-14 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
-+-
 Reporter:  rogerhu  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.6
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by Tim Graham ):

 In [changeset:"9a446211bd13998aa6f0b6a3e6e6cdd1c69df704"]:
 {{{
 #!CommitTicketReference repository=""
 revision="9a446211bd13998aa6f0b6a3e6e6cdd1c69df704"
 [1.6.x] Fixed #21566 -- Fixed AttributeError when using bulk_create with
 ForeignObject.

 Backport of bbc73e6a12 from master.
 }}}

-- 
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/065.e446793a35c32505f3be680fcb022bda%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2013-12-06 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
-+-
 Reporter:  rogerhu  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.6
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Baptiste Mispelon ):

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


Comment:

 In [changeset:"bbc73e6a12227f5ed52fd38bc37f56f434a0a72c"]:
 {{{
 #!CommitTicketReference repository=""
 revision="bbc73e6a12227f5ed52fd38bc37f56f434a0a72c"
 Fixed #21566 -- Fixed AttributeError when using bulk_create with
 ForeignObject.
 }}}

-- 
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/065.f36ff48420cee0d29f107af8c4a206cc%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2013-12-06 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
-+-
 Reporter:  rogerhu  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.6
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by rogerhu):

 Thanks.  I fixed against your comments.  Also, since bulk creation is
 disabled for inherited models, local_concrete_fields vs. concrete_fields
 may not matter too much, but I've changed.  Thanks again for the fast
 review!

-- 
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/065.dac30fda4289e75ecd4b23ed643393a4%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2013-12-06 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
-+-
 Reporter:  rogerhu  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.6
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by bmispelon):

 * component:  Uncategorized => Database layer (models, ORM)
 * needs_better_patch:  0 => 1
 * type:  Uncategorized => Bug
 * stage:  Unreviewed => Accepted


Comment:

 Hi,

 I can reproduce the issue being reported and the provided patch does seem
 to fix the problem.

 I left a few comments on the pull request. Once those are fixed I think
 this should be good to go.

 Thanks.

-- 
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/065.d2f91494ebfffd17566701516dd3a37b%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2013-12-05 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
---+--
 Reporter:  rogerhu|Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Uncategorized  |  Version:  1.6
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by rhu@…):

 PR at https://github.com/django/django/pull/2038

-- 
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/065.40ff51c999a4a8394848b49e838f3e69%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2013-12-05 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
---+--
 Reporter:  rogerhu|Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Uncategorized  |  Version:  1.6
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by rhu@…):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 ```
 --- a/django/db/models/query.py
 +++ b/django/db/models/query.py
 @@ -389,7 +389,7 @@ class QuerySet(object):
  return objs
  self._for_write = True
  connection = connections[self.db]
 -fields = self.model._meta.local_fields
 +fields = self.model._meta.concrete_fields
  with transaction.commit_on_success_unless_managed(using=self.db):
  if
 (connection.features.can_combine_inserts_with_and_without_auto_increment_pk
  and self.model._meta.has_auto_field):
 diff --git a/tests/foreign_object/tests.py b/tests/foreign_object/tests.py
 index 66f57b6..b1502c3 100644
 --- a/tests/foreign_object/tests.py
 +++ b/tests/foreign_object/tests.py
 @@ -4,7 +4,7 @@ from operator import attrgetter
  from .models import (
  Country, Person, Group, Membership, Friendship, Article,
  ArticleTranslation, ArticleTag, ArticleIdea, NewsArticle)
 -from django.test import TestCase
 +from django.test import TestCase, skipUnlessDBFeature
  from django.utils.translation import activate
  from django.core.exceptions import FieldError
  from django import forms
 @@ -380,6 +380,13 @@ class MultiColumnFKTests(TestCase):
  'active_translation')[0].active_translation.title,
  "foo")

 +@skipUnlessDBFeature('has_bulk_insert')
 +def test_batch_create_foreign_object(self):
 +self.bob.person_country = self.usa
 +
 +objs = [Person(name=i, person_country=self.usa) for i in range(0,
 5)]
 +Person.objects.bulk_create(objs, 10)
 +

 ```

-- 
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/065.5abc23f00226ec7610f64d82b8972b75%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Django] #21566: Creation of models with ForeignObject fails with bulk_create() function

2013-12-05 Thread Django
#21566: Creation of models with ForeignObject fails with bulk_create() function
---+
 Reporter:  rogerhu|  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Component:  Uncategorized  |Version:  1.6
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  0  |  UI/UX:  0
---+
 The bulk_create() function uses local_fields instead of concrete_fields.

-- 
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/050.0e74312eb92b1a27d6f51c96b5b5985c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.