﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28419	Support for value() usage with PostgreSQL-specific JSONFields	daishi	nobody	"This is a feature request for the PostgreSQL-specific JSONField documented here:

  https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/fields/#jsonfield

Following from the example starting at:

  https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/fields/#key-index-and-path-lookups

It would be great if the extended field naming allowed the following to succeed:
{{{
>>> Dog.objects.values('data__breed')
Traceback (most recent call last):
  File ""<console>"", line 1, in <module>
  File ""/Users/daishi/.virtualenvs/testdjango/lib/python2.7/site-packages/django/db/models/manager.py"", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File ""/Users/daishi/.virtualenvs/testdjango/lib/python2.7/site-packages/django/db/models/query.py"", line 697, in values
    clone = self._values(*fields, **expressions)
  File ""/Users/daishi/.virtualenvs/testdjango/lib/python2.7/site-packages/django/db/models/query.py"", line 692, in _values
    clone.query.set_values(fields)
  File ""/Users/daishi/.virtualenvs/testdjango/lib/python2.7/site-packages/django/db/models/sql/query.py"", line 1896, in set_values
    self.add_fields(field_names, True)
  File ""/Users/daishi/.virtualenvs/testdjango/lib/python2.7/site-packages/django/db/models/sql/query.py"", line 1645, in add_fields
    name.split(LOOKUP_SEP), opts, alias, allow_many=allow_m2m)
  File ""/Users/daishi/.virtualenvs/testdjango/lib/python2.7/site-packages/django/db/models/sql/query.py"", line 1417, in setup_joins
    names, opts, allow_many, fail_on_missing=True)
  File ""/Users/daishi/.virtualenvs/testdjango/lib/python2.7/site-packages/django/db/models/sql/query.py"", line 1385, in names_to_path
    "" not permitted."" % (names[pos + 1], name))
FieldError: Cannot resolve keyword 'breed' into field. Join on 'data' not permitted.
}}}

I would expect the result to be `['labrador', 'collie']` (or the `QuerySet` equivalent thereof)."	New feature	closed	contrib.postgres	1.11	Normal	duplicate			Unreviewed	0	0	0	0	0	0
