#28406: bug with HStore that has a default value of empty dict - {}
-------------------------------------+-------------------------------------
               Reporter:  eyaleee    |          Owner:  nobody
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:  hstore
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 using django version 1.11.2 I have in one of my models an HStoreField.
 I've defined this field with "default={}" in the model definition, so when
 creating a new object (using objects.create) - the new hstore field will
 be an empty dictionary.

 however - there is a weird bug, If I create a first object, it is created
 with an empty dict indeed. but when creating another object, instead of an
 empty dictionary - it is loaded with the dictionary of the previous, non-
 related object!!. I'm not sure where's the problem in django's code but
 maybe it's related to models/base.py, in line 518 there's a "if kwargs"
 which returns false in the case of the empty dict that is my default.
 maybe it should return something?

 my workaround was simple of course - stop using the default value. just
 wanted to let you know...

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28406>
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/050.c868cc4e7e50f22c2e593e7874dbe99e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to