擅长:python、mysql、java
<p>使用Django 1.8:</p>
<pre><code>from django.contrib.postgres.operations import HStoreExtension
class Migration(migrations.Migration):
...
operations = [
HStoreExtension(),
...
]
</code></pre>
<p><a href="https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/#hstorefield" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/#hstorefield</a></p>
<p>编辑:请注意还有一个<a href="https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/fields/#jsonfield" rel="nofollow noreferrer">JSONField</a>,它处理(取消)json的编组和内联搜索。它不需要HStoreExtension。要求Django>;=1.11和Postgres>;=9.4。在</p>