[Django] #25615: multidm Relation fields do not support nested lookups

25 views
Skip to first unread message

Django

unread,
Oct 27, 2015, 8:54:50 AM10/27/15
to django-...@googlegroups.com
#25615: multidm Relation fields do not support nested lookups
-------------------------------+--------------------
Reporter: gerdkoetje | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
He all,

Does anyone know why i can't do any relation lookups on any database other
then the default database in 1.8.5 this worked fine in 1.6.1
it keeps trowing me: Relation fields do not support nested lookups

for example on
adds =
ProfielenFlirts.objects.filter(voor__user__profielenuserprofile__fictief=True).filter(Q(antwoord='')
| Q(antwoord__isnull=True)).count()

ProfielenFlirts is a non default database, the relation lookup is in the
same database do.


my router
class DatingRouter(object):
def db_for_read(self, model, **hints):
if model._meta.app_label == 'datingmodels':
return 'dating'
return 'default'

def db_for_write(self, model, **hints):
if model._meta.app_label == 'datingmodels':
return 'dating'
return 'default'

def allow_relation(self, obj1, obj2, **hints):
if obj1._meta.app_label == 'datingmodels' and obj2._meta.app_label
== 'datingmodels':
return True
elif 'datingmodels' not in [obj1._meta.app_label,
obj2._meta.app_label]:
return True
return False

def allow_syncdb(self, db, model):
if db == 'dating' or model._meta.app_label == "datingmodels":
return False # we're not using syncdb on our legacy database
else: # but all other models/databases are fine
return True

any help would be appriciated

--
Ticket URL: <https://code.djangoproject.com/ticket/25615>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 27, 2015, 8:55:30 AM10/27/15
to django-...@googlegroups.com
#25615: multidm Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by gerdkoetje):

* component: Uncategorized => Database layer (models, ORM)
* needs_better_patch: => 0
* type: Uncategorized => Bug
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:1>

Django

unread,
Oct 27, 2015, 8:56:10 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody

Type: Bug | Status: new
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:2>

Django

unread,
Oct 27, 2015, 9:21:16 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | 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: => needsinfo


Old description:

New description:

Does anyone know why i can't do any relation lookups on any database other

then the default database in 1.8.5 this worked fine in 1.6.1. It keeps
telling me: `Relation fields do not support nested lookups`.

--

Comment:

Please provide a minimal sample project that works on 1.6 and fails on
1.8. The simpler you can make the sample project, the easier it will be to
determine if it's a bug in your application or in Django. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:3>

Django

unread,
Oct 27, 2015, 10:54:49 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Old description:

> Does anyone know why i can't do any relation lookups on any database

> other then the default database in 1.8.5 this worked fine in 1.6.1. It
> keeps telling me: `Relation fields do not support nested lookups`.

New description:

He all,

--

Comment (by gerdkoetje):

test project proving this issue
https://github.com/gerdkoetje/dualdbtest

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:4>

Django

unread,
Oct 27, 2015, 11:10:16 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by gerdkoetje):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:5>

Django

unread,
Oct 27, 2015, 11:30:33 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | 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: => invalid


Comment:

Bisected to 9f13c3328199d2fa70235cdc63bb06b1efc5b117. You are missing
'seconddbapp' in `INSTALLED_APPS`.

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:6>

Django

unread,
Oct 27, 2015, 11:45:05 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by gerdkoetje):

in my main project that is a remote database.
that shouldn't be in installed apps.
so i did the same here.

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:7>

Django

unread,
Oct 27, 2015, 11:45:17 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by gerdkoetje):

* status: closed => new

* resolution: invalid =>


--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:8>

Django

unread,
Oct 27, 2015, 11:51:51 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody

Type: Bug | Status: new
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by gerdkoetje):

what does this mean?
https://github.com/django/django/commit/9f13c3328199d2fa70235cdc63bb06b1efc5b117

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:9>

Django

unread,
Oct 27, 2015, 11:52:28 AM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | 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: => invalid


Comment:

I don't understand your reasoning. You cannot import models from
seconddbapp in otherapp if you don't include it in `INSTALLED_APPS`. Maybe
you want to set them as `managed=False` if those apps aren't managed by
the local Django installation. Let's continue the discussion on django-
users if you need further help. I don't see any bugs in Django yet.

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:10>

Django

unread,
Oct 27, 2015, 12:01:34 PM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by gerdkoetje):

you don't get my point.
seconde is a remote database in my real project.
and im not able to do reverse lookups on any other db then the default on.
with did work fine in 1.6.1

this is what i did try to prove with this project, only i can't add a
remote database to it so i used a locale database for it.

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:11>

Django

unread,
Oct 27, 2015, 12:01:39 PM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by gerdkoetje):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:12>

Django

unread,
Oct 27, 2015, 12:20:27 PM10/27/15
to django-...@googlegroups.com
#25615: multidb Relation fields do not support nested lookups
-------------------------------------+-------------------------------------
Reporter: gerdkoetje | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | 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: => invalid


Comment:

Let's keep this ticket closed until there is a conclusion on django-users
that Django is at fault.

--
Ticket URL: <https://code.djangoproject.com/ticket/25615#comment:13>

Reply all
Reply to author
Forward
0 new messages