Changes between Initial Version and Version 2 of Ticket #27886


Ignore:
Timestamp:
Feb 28, 2017, 8:09:32 AM (7 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27886

    • Property Type UncategorizedBug
  • Ticket #27886 – Description

    initial v2  
    66
    77The code is relatively simple - it creates a Task object in the database and it uses JSONField  from contrib.postgres on signature field.
    8 
     8{{{
    99    sig = to_signature(func, args, kwargs)
    1010    if parent is None and previous:
    1111        parent = previous.parent
    1212    task = Task.objects.create(signature={}, parent=parent, previous=previous, **kw)
    13 
     13}}}
    1414When I access task objcect directly then I get
    15 
     15{{{
    1616task.__dict__
    1717Out[2]:
     
    3838 'submitted': datetime.datetime(2017, 2, 28, 13, 47, 46, 329656, tzinfo=<UTC>),
    3939 'waiting_on_id': None}
    40 
    41 However, when I do refresh the instsance from db by doing task.refresh_from_db() and then task.__dict__
     40}}}
     41However, when I do refresh the instance from db by doing `task.refresh_from_db()` and then `task.__dict__`
    4242
    4343I will receive this variation which has completely different quoting on JSONField fields (signature and details)
    44 
     44{{{
    4545Out[4]:
    4646{'_state': <django.db.models.base.ModelState at 0x83fcfd0>,
     
    6262 'submitted': datetime.datetime(2017, 2, 28, 13, 47, 46, 329656, tzinfo=<UTC>),
    6363 'waiting_on_id': None}
    64 
     64}}}
    6565
    6666What could be root cause of the problem? Is it a bug in django?
     
    6868I use windows 10 pro, postgres 95, python 3.5 32bit
    6969
    70 
    71 This ticket might be related with:
    72 https://code.djangoproject.com/ticket/25532#no2
     70#25532 might be related.
Back to Top