I'm migrating a Django app from 1.11.16 to 4.0.5 and django-picklefield will be migrated also from 2.0 to 3.1 .
A django object has the following line:
from picklefield.fields import PickledObjectField
class A(models.Model):
...
log_list = PickledObjectField(default=list)
.
Using the old code (1.11.16) and the new code (4.0.5) results a totally different result for the query:
#old
Obj.objects.get(id=4737).log_list
[{u'date': datetime.datetime(2022, 6, 27, 12, 54, 50, 746392),
u'message': u'Fetching trademark search started',
u'typ': u'info'},
{u'date': datetime.datetime(2022, 6, 27, 12, 54, 53, 423384),
u'message': u'Fetching trademark search finished',
u'typ': u'info'}]
#type == list
#new
Obj.objects.get(id=4737).log_list
gAJdcQEofXECKFgEAAAAZGF0ZXEDY2RhdGV0aW1lCmRhdGV0aW1....
#so it results exactly what is stored in the db.
#type == str
With picklefield version 3.1 is there anything else I need to do / change to have the behaviour than with version == 2.0 ? What should I do with the new setup to get the list instead of the str?