Django 1.11: JSONField loaded as string during migration's RunPython

48 views
Skip to first unread message

hector...@unholster.com

unread,
May 25, 2017, 3:15:07 PM5/25/17
to Django users, Jaime Bauzá, Rafael Elizondo, Rafael Torres, Saúl Hormazabal, Exequiel Fuentes, Felipe Narvaez, Andres Villavicencio
Hello,

We are moving to Django 1.11, but we have some models with JSONField fields, which are being used on some custom migration functions (called with RunPython). We're getting the following kind of errors:

    _ForecastType = apps.get_model('forecast', 'forecasttype')
    for forecast_type in _ForecastType.objects.all():
>     hours = forecast_type.params['reception_hours']
E     TypeError: string indices must be integers

so Django is not properly loading the field during the migration. What should we do to fix it?

Thanks very much for any help,
Hector.

hector...@unholster.com

unread,
May 26, 2017, 4:36:25 PM5/26/17
to Django users, jaime...@unholster.com, rafael....@unholster.com, rafael...@unholster.com, saul.ho...@unholster.com, exequiel...@unholster.com, felipe....@unholster.com, and...@unholster.com
This was a problem generated by django-jsonfield v1.0.1

CLOSED.
Reply all
Reply to author
Forward
0 new messages