Changes between Initial Version and Version 2 of Ticket #27886
- Timestamp:
- Feb 28, 2017, 8:09:32 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27886
- Property Type Uncategorized → Bug
-
Ticket #27886 – Description
initial v2 6 6 7 7 The code is relatively simple - it creates a Task object in the database and it uses JSONField from contrib.postgres on signature field. 8 8 {{{ 9 9 sig = to_signature(func, args, kwargs) 10 10 if parent is None and previous: 11 11 parent = previous.parent 12 12 task = Task.objects.create(signature={}, parent=parent, previous=previous, **kw) 13 13 }}} 14 14 When I access task objcect directly then I get 15 15 {{{ 16 16 task.__dict__ 17 17 Out[2]: … … 38 38 'submitted': datetime.datetime(2017, 2, 28, 13, 47, 46, 329656, tzinfo=<UTC>), 39 39 'waiting_on_id': None} 40 41 However, when I do refresh the inst sance from db by doing task.refresh_from_db() and then task.__dict__40 }}} 41 However, when I do refresh the instance from db by doing `task.refresh_from_db()` and then `task.__dict__` 42 42 43 43 I will receive this variation which has completely different quoting on JSONField fields (signature and details) 44 44 {{{ 45 45 Out[4]: 46 46 {'_state': <django.db.models.base.ModelState at 0x83fcfd0>, … … 62 62 'submitted': datetime.datetime(2017, 2, 28, 13, 47, 46, 329656, tzinfo=<UTC>), 63 63 'waiting_on_id': None} 64 64 }}} 65 65 66 66 What could be root cause of the problem? Is it a bug in django? … … 68 68 I use windows 10 pro, postgres 95, python 3.5 32bit 69 69 70 71 This ticket might be related with: 72 https://code.djangoproject.com/ticket/25532#no2 70 #25532 might be related.