HStoreField - Field value is an object usually, but a string when in shell

27 views
Skip to first unread message

Andrew Grossman

unread,
Mar 22, 2016, 1:15:28 PM3/22/16
to Django users
I'm working with a model that has an HStoreField field named "options". The options field on a model instance is a dictionary when running the webserver, but is a string when in the shell. This isn't simply a matter of it being coerced by the shell; the model's attribute dictionary and dir() calls against the member both indicate that options is a string.

Any thoughts on why this might behave differently? Nothing jumped out at me in the Django source.

Tim Graham

unread,
Mar 23, 2016, 9:40:08 AM3/23/16
to Django users
Are you using the same settings file in both cases? I think this might happen if you don't have django.contrib.postgres in INSTALLED_APPS which would mean register_hstore_handler() isn't called.
Reply all
Reply to author
Forward
0 new messages