django/django — pull request #3219 by mjtamlyn (2014-09-14 08:40:53+00:00)
Title: [WIP] hstore

Beginnings of an `hstore` implementation. TODO:

- [x] support migrations to create the extension and register with psycopg2
- [ ] expand the field definition, including restriction of variables
- [ ] form field
- [ ] add lookups
- [ ] consider custom manager methods (`hkeys` etc). Perhaps nicer to provide extra sugar for `.extra()` or similar?

There is a design decision to make: do we want a simplistic hstore field which follows the rules of hstore itself - restricts to strings and null, or do we want something a bit more clever like `django-hstore` provides that does some json encoding on non-string types? I currently lean towards the former as we will also have support for a `jsonb` field for more rich data. This would also remove a lot of complexity from the `django-hstore` implementation - descriptors, subclasses of dict etc.