How to create key value data type in django 1.7 models
<p>I want to store key-value pair in one column.</p>

<p>Above >Django-1.7 provides hstore to do that.</p>

<p>But I want to same functionality in Django-1.7.</p>

<p>How can I create custom datatype to store key-value pair in one column.</p>

<p>I am using postgres-9.5 database.</p>

<p>I want to store below json in key value pair in one column.</p>

<p>Example:</p>

<pre><code>{
    "prepared_date":"2016-08-08T02:04:34Z",
    "date_0":"2016-08-08T02:04:34Z",
    "status_0":true,
    "date_1":"2016-08-08T02:04:34Z",
    "status_1":true,
    "date_2":"2016-08-08T02:04:34Z",
    "status_2":true,
}
</code></pre>

<p>There's a nice package exactly for this purpose:</p>

<p><a href="http://djangonauts.github.io/django-hstore/" rel="nofollow">http://djangonauts.github.io/django-hstore/</a></p>

<p>So just install using pip:</p>

<pre><code>pip install django-hstore
</code></pre>

python django postgresql django-models django-custom-field