django-hstore

How exactly do I have to use HStoreField?

自闭症网瘾萝莉.ら 提交于 2020-01-16 19:22:17
问题 I'm using the latest version of Django and DRF. But after running it I'm getting this error: class HStoreDescriptor(models.fields.subclassing.Creator): AttributeError: module 'django.db.models.fields' has no attribute 'subclassing' I'm not sure how to use HStoreField and create an extension using migration. This is my structure of the file. webhook10/ |-- tutorial/ | |-- slack/ | | |-- migrations/ | | | +-- __init__.py | | |-- __init__.py | | |-- admin.py | | |-- apps.py | | |-- models.py | |

HStore field insert issue

匆匆过客 提交于 2019-12-02 04:55:57
问题 I am trying to insert a dictionary into the htore from my python shell and I keep getting this error: django.db.utils.ProgrammingError: function hstore(text[], integer[]) does not exist LINE 1: ...ula" = hstore(ARRAY['function', 'formula'], ARRAY[hstore(ARR... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. The queryset I am using is this: Formula.objects.get_or_create(formula={ 'function': { 'round': 0}, 'formula': {'a': 0.2 , 'b': 5,

HStore field insert issue

旧城冷巷雨未停 提交于 2019-12-02 01:25:32
I am trying to insert a dictionary into the htore from my python shell and I keep getting this error: django.db.utils.ProgrammingError: function hstore(text[], integer[]) does not exist LINE 1: ...ula" = hstore(ARRAY['function', 'formula'], ARRAY[hstore(ARR... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. The queryset I am using is this: Formula.objects.get_or_create(formula={ 'function': { 'round': 0}, 'formula': {'a': 0.2 , 'b': 5, 'c': 4, 'd': 4, 'e': 1}}) Also, I have created the hstore extension and added the app django_hstore.