#29473: Postgres JSONField escaping to infinity on each save
-------------------------------------+-------------------------------------
               Reporter:  Laurynas   |          Owner:  (none)
  Riliskis                           |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  2.0
  contrib.postgres                   |       Keywords:  postgress
               Severity:  Normal     |  JSONFields
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 postgress JSONFields are escaping to infinity as you can see in the input
 below. The same behavior is reproduced through the admin interface.

 I commented in bug https://code.djangoproject.com/ticket/26110 but not
 sure if the issue if the same.

 {{{
 import uuid
 from django.db import models
 from django.contrib.postgres.fields import JSONField

 class PublishedConsent(models.Model):
     uuid = models.UUIDField(
             default=uuid.uuid4,
             editable=False)
     json = JSONField()
 }}}



 {{{
 >>> p = JSONTest.objects.get(instance="4550d7f3a28c4081af5b3ff5ac62ab60")
 >>> p.data
 '{}'
 >>> p.save()
 >>> p = JSONTest.objects.get(instance="4550d7f3a28c4081af5b3ff5ac62ab60")
 >>> p.data
 '"{}"'
 >>> p.save()
 >>> p = JSONTest.objects.get(instance="4550d7f3a28c4081af5b3ff5ac62ab60")
 >>> p.data
 '"\\"{}\\""'
 >>> p.save()
 >>> p = JSONTest.objects.get(instance="4550d7f3a28c4081af5b3ff5ac62ab60")
 >>> p.data
 '"\\"\\\\\\"{}\\\\\\"\\""'
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29473>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.8a4c7ad1c0f23051bbfb1515e3f9320b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to