JSONField from django.contrib.postgres, but with a fallback to TextField
Project description
This is an extension to django.contrib.postgres.fields.JSONField, that works on other databases than PostgreSQL. On these databases, it falls back to storing plain JSON content in a text field. It handles serialization and deserialization transparently for you, but advanced query features for JSON fields are only available on PostgreSQL.
We’d love to see this extended by using the django-mysql implementation on MySQL, but we lack the development capacity to do this. If you’d like to contribute, just get in touch!
Compatible with:
Python 3.4 to 3.6
Django 2.0 to 2.1
SQlite, MySQL, PostgreSQL
Usage
Just use our drop-in replacement for JSONField:
from django.db import models from jsonfallback.fields import FallbackJSONField class Book(models.Model): data = FallbackJSONField() def __str__(self): return str(self.data['title'])
License
The code in this repository is published under the terms of the Apache License. See the LICENSE file for the complete license text.
This project is maintained by Raphael Michel <mail@raphaelmichel.de>. See the AUTHORS file for a list of all the awesome folks who contributed to this project.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-jsonfallback-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9abc55913323ef740c3e58f2a8932feb7565a3408e618d959e22eca84a612ae |
|
MD5 | 429d06712d96ba2bb4756e13879e839a |
|
BLAKE2b-256 | 318c9477aca49d8e143378492287fe395ee8a359229291d4456b33e13e13b7ef |
Hashes for django_jsonfallback-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6fdfe2b56331a23da2e65e306db0362f2070d2bbabccf4063c4a792fbb7b704 |
|
MD5 | 645b8659f891c9b4d043d0841f9f9b7e |
|
BLAKE2b-256 | 111585b9c0636f074bcc130294b35f4441bde84d3f623ecdb048f5e2247d0ecd |