Skip to content

baseplate-admin/django-hstore-field

Repository files navigation

django-hstore-field

PyPI Downloads CI Pypi Badge pre-commit.ci status

An easy to use postgres hstore field that is based on django-hstore-widget

Requirements

  • Python 3.9 and Up ( well technically any python version from 3.6 should work )
  • Django 3.2 and Up
  • Modern browsers ( Chrome 112+, Firefox 117+, Safari 16.5+ or any browsers supporting css nesting )

Installation

pip install django-hstore-field

Usage

Option 1:

Include django-hstore-widget in your settings.py's INSTALLED_APPS:

# settings.py

INSTALLED_APPS = [
    ...,
    'django_hstore_widget',
    ...
]

Option 2:

Include django-hstore-widget's migration to any of your model's migration:

# Generated migration file
from django.db import migrations, models
import django.contrib.postgres.fields


class Migration(migrations.Migration):
    dependencies = [
        ("django_hstore_widget", "__latest__"),
    ]

    operations = [
        ...
    ]

and then use it:

# yourapp/models.py
from django.db import models
from django_hstore_field import HStoreField


class ExampleModel(models.Model):
    data = HStoreField()

Example:

Check the cats directory

Note

If you want a lower level implementation, please check django-hstore-widget.

About

An easy to use postgres hstore field that is based on django-hstore-widget

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages