Django 1.9 - JSONField

343 views
Skip to first unread message

lza...@ucs.br

unread,
Jul 7, 2015, 9:57:37 AM7/7/15
to django-d...@googlegroups.com

Hi all,

I'd like to know why this feature will be only available on postgres and not as a Field for any database, like this product? This Field would be very usefull for many users I think.

https://github.com/bradjasper/django-jsonfield

https://docs.djangoproject.com/en/dev/releases/1.9/#django-contrib-postgres

By.

Michael Manfre

unread,
Jul 7, 2015, 10:39:29 AM7/7/15
to django-d...@googlegroups.com
The django-contrib-postgres JSONField takes advantage of JSON being a native type that allows it's data fields to be used by the ORM, instead of just a text field that wraps json.dumps() and json.loads(). All of the core supported backends seem to have some flavor of native JSON support (MS SQL is adding native JSON in SQL Server 2016). I haven't investigated whether or not they could be sanely implemented as a common field. That might be a worthwhile change to target for Django 1.10, guarded by a DatabaseFeature for all of the earlier versions of each database that don't support it.

Regards,
Michael Manfre


Enviado via UCSMail.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/0459e983-7098-475c-9e3f-14a076513f4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
GPG Fingerprint: 74DE D158 BAD0 EDF8

Marc Tamlyn

unread,
Jul 7, 2015, 11:49:53 AM7/7/15
to django-d...@googlegroups.com
Agreed, as other databases catch up with the feature set offered in contrib.postgres I think moving this field into core is likely - it's a field that a number of databases are working on adding. It's worth noting that the PG implementation is 9.4+ only, the 9.2/9.3 implementation of json should not be used.

There are many suitable third party apps which do a simple dumps/loads around a text blob. There isn't really any benefit in adding this to core in my opinion.

Григорий Крамаренко

unread,
Jul 8, 2015, 4:38:42 AM7/8/15
to django-d...@googlegroups.com
+1
I'm waiting too and hope for a positive decision.

вторник, 7 июля 2015 г., 23:57:37 UTC+10 пользователь lza...@ucs.br написал:

Collin Anderson

unread,
Jul 8, 2015, 8:03:38 AM7/8/15
to django-d...@googlegroups.com
Sounds good to me, though I think we should wait until there's actually native JSON support in one of the other databases. MariaDB has "dynamic columns" which I think is more similar to Postgres's hstore.

Christopher Allan Webber

unread,
Jul 8, 2015, 5:19:12 PM7/8/15
to django-d...@googlegroups.com
Postgres' jsonb has some pretty unique features that I'm not sure any
other databases are going to implement anytime soon, and even if they
did, it would probably be in a fairly incompatible way, yeah? It would
be nice to get this included into Django itself, and have it noted as a
Postgres-only feature. Then if other databases can eventually catch up,
include them alongside it.

Shai Berger

unread,
Jul 11, 2015, 6:57:58 AM7/11/15
to django-d...@googlegroups.com
On Thursday 09 July 2015 00:18:09 Christopher Allan Webber wrote:
> [...] It would
> be nice to get this included into Django itself, and have it noted as a
> Postgres-only feature. Then if other databases can eventually catch up,
> include them alongside it.
>
I have to repeat Marc's implied question: What is the benefit of doing that, as
opposed to "noting it as Postgres-only" by keeping it in
django.contrib,postgres?
Reply all
Reply to author
Forward
0 new messages