#36289: Postgres bulk_create error when geometry is null or a different SRID
-------------------------------------+-------------------------------------
     Reporter:  Joshua Goodwin       |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  5.2
  (models, ORM)                      |
     Severity:  Release blocker      |               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 Sarah Boyce):

 * cc: Simon Charette, Mariusz Felisiak (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted

Comment:

 Replicated, regression in a16eedcf9c69d8a11d94cac1811018c5b996d491
 Basic regression test if useful:
 {{{#!diff
 --- a/tests/gis_tests/geo3d/models.py
 +++ b/tests/gis_tests/geo3d/models.py
 @@ -58,7 +58,7 @@ class SimpleModel(models.Model):


  class Point2D(SimpleModel):
 -    point = models.PointField()
 +    point = models.PointField(null=True)


  class Point3D(SimpleModel):
 diff --git a/tests/gis_tests/geo3d/tests.py
 b/tests/gis_tests/geo3d/tests.py
 index b37deabb46..af772b07d6 100644
 --- a/tests/gis_tests/geo3d/tests.py
 +++ b/tests/gis_tests/geo3d/tests.py
 @@ -206,6 +206,10 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
          lm.save()
          self.assertEqual(3, MultiPoint3D.objects.count())

 +    def bulk_create_point_field(self):
 +        objs = Point2D.objects.bulk_create([Point2D(), Point2D()])
 +        self.assertEqual(len(objs), 2)
 +
      @skipUnlessDBFeature("supports_3d_functions")
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36289#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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070195fa6a7005-b826ecab-b4c3-4da5-9b3a-17bfffdc7cfa-000000%40eu-central-1.amazonses.com.

Reply via email to