Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-08-25 Thread Django
#25995: Add more sophisticated serialization support to JSONField
-+-
 Reporter:  jimgraham|Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  contrib.postgres |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  JSONB| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"13c3e5d5a05e9c358d212d154addd703cac3bc66" 13c3e5d]:
 {{{
 #!CommitTicketReference repository=""
 revision="13c3e5d5a05e9c358d212d154addd703cac3bc66"
 Fixed #25995 -- Added an encoder option to JSONField

 Thanks Berker Peksag and Tim Graham for the reviews.
 }}}

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.29d00e85a17755669d068e7969c5dbe2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-08-24 Thread Django
#25995: Add more sophisticated serialization support to JSONField
-+-
 Reporter:  jimgraham|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  contrib.postgres |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  JSONB| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by berkerpeksag):

 * stage:  Accepted => Ready for checkin


Comment:

 [https://github.com/django/django/pull/7071 PR #7071] looks good to me. I
 left a comment about the type of the `encoding` parameter in the pull
 request.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.de9daa9c1346332b7b98042a0b12f1cb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-08-12 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by claudep):

 * has_patch:  0 => 1


Comment:

 This [https://github.com/django/django/pull/7071 PR] adds custom encoding
 support.

 The decoding part is another story. The patch currently recommends using
 `from_db`/`from_db_value` hooks. If anyone can come with a concrete
 proposal with another method, please propose it.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.bde7d81764ddaf5ef1d01ab723ab8c64%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-07-05 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by debanshuk):

 * cc: debanshuk2007@… (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.cd18a73b862f0750263e96ed92602e84%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-07-05 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by debanshuk):

 We could use a custom data type representation scheme to represent dates,
 decimals etc in JSON.

 The scheme could be similar to what MongoDB uses for it's extended JSON
 (https://docs.mongodb.com/manual/reference/mongodb-extended-json/#bson-
 data-types-and-associated-representations).
 Eg: a date object would be stored as {{{ {"$date": }
 }}}

 Or,

 It could be something more sophisticated and generic like
 {{{
 {
 "$djExtJson": {
 "$type": ,
 "$args": ,
 "$kwargs": 
 }
 }
 }}}
 Where '$type' would be the full path of a class (eg, {{{ datetime.date }}}
 or {{{ decimal.Decimal }}}) and '$args' and '$kwargs' would be the
 arguments for constructor of the class.

 So a date object would be stored as:
 {{{
 {"$djExtJson": {"$type": "datetime.date", "$args": ["2016", "7", "6"]}}
 }}}

 and a decimal object as:
 {{{
 {"$djExtJson": {"$type": "decimal.Decimal", "$args": ["21.5"]}}
 }}}

 Using this format, one would be able to store any class's object in JSON.
 Eg:
 {{{
 # my_utils.py
 class ABC():
 def __init__(self, dt: date):
 self.date = dt
 }}}
 An object of above class could be stored as:
 {{{
 {"$djExtJson": {
 "$type": "my_utils.ABC",
 "$args": [{"$djExtJson": {"$type": "datetime.date", "$args": ["2016",
 "7", "6"]}}]
 }}
 }}}

 Deserialisation of objects using above format would be very simple, as we
 would have type information stored withing the object with all the
 arguments required to call constructor of that type, so we would be able
 to call the constructor and get the object.

 For serialisation, it won't be possible to get arguments which need to be
 passed to a class's constructor just by looking at a object of that class.
 So for that, we can have custom code in Django for supporting
 serialisation of common standard library objects and builtins. And for
 user defined classes, we can created a mixin (we may call it {{{
 DjExtJsonSerialisable }}}) which would simply stores arguments (and
 keyword arguments) passed to the constructor of a user defined class in
 some attribute, when a object of a class inheriting from at mixin is
 created (attribute can {{{ __dj_ext_json_data__ }}}).

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.16d12b3c5189dd56f1bf4ca98a87a0d1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-01-08 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Tim Graham ):

 In [changeset:"3503b816cf449c7c94766c8f3f890a52083db392" 3503b81]:
 {{{
 #!CommitTicketReference repository=""
 revision="3503b816cf449c7c94766c8f3f890a52083db392"
 [1.9.x] Refs #25995 -- Documented that JSONField doesn't handle
 sophisticated serialization.

 Backport of c432dd40bde37667bfe6bb59eaff0a14c50cd27b from master
 }}}

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1b8c03437b67b3c84f2f9b735d51ad66%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-01-08 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Tim Graham ):

 In [changeset:"c432dd40bde37667bfe6bb59eaff0a14c50cd27b" c432dd40]:
 {{{
 #!CommitTicketReference repository=""
 revision="c432dd40bde37667bfe6bb59eaff0a14c50cd27b"
 Refs #25995 -- Documented that JSONField doesn't handle sophisticated
 serialization.
 }}}

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.aaf212fe03ca6bd2467a6da3cb253352%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-01-07 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by zachborboa):

 * cc: zachborboa@… (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.06a1d56432266cdd30341af890bc4584%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-01-05 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timgraham):

 * version:  1.9 => master
 * stage:  Unreviewed => Accepted


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.5764e929325ddfa43830ab12b7c8d121%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField

2016-01-05 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+--
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.postgres  |  Version:  1.9
 Severity:  Normal|   Resolution:
 Keywords:  JSONB | Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by aaugustin):

 * status:  closed => new
 * resolution:  wontfix =>


Comment:

 I hit the same problem: https://groups.google.com/d/msg/django-
 developers/upg9pgGvaUs/LMN8Xfq8EQAJ

 If Django doesn't provide an escape hatch, I suspect I won't be the only
 one to resort to monkey-patching.

 Right now I don't have time to dig into this issue but I don't think we
 can leave it there altogether.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.94e3a49ce0b7815a115da7547be963db%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25995: Add more sophisticated serialization support to JSONField (was: Support serialization to `django.contrib.postgres.fields.jsonb.py`)

2016-01-04 Thread Django
#25995: Add more sophisticated serialization support to JSONField
--+--
 Reporter:  jimgraham |Owner:  nobody
 Type:  New feature   |   Status:  closed
Component:  contrib.postgres  |  Version:  1.9
 Severity:  Normal|   Resolution:  wontfix
 Keywords:  JSONB | Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 [https://github.com/django/django/pull/5928 Doc patch]. I avoided
 recommending a particular third-party field since we avoid that as it's
 difficult to curate a list of packages that doesn't go stale.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.535569757e7b5858aff7224d9b464c17%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.