#26186: When extending from abstract model, ForeignKey points to wrong
application
-------------------------------------+-------------------------------------
Reporter: skyjur | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(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 skyjur):
I have added another test case showing that in 1.9 it's impossible to
extend from abstract models if they contain foreign keys to abstract model
that is not inside an installed app.
In 1.8 this was possible:
https://github.com/skyjur/django-ticketing/tree/master/ticket_26186_2
tox output:
{{{
django189 runtests: commands[0] | django-admin test
Creating test database for alias 'default'...
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
Destroying test database for alias 'default'...
django192 runtests: commands[0] | django-admin test
Creating test database for alias 'default'...
Traceback (most recent call last):
<...>
self._related_fields = self.resolve_related_fields()
File "django-ticketing/ticket_26186/.tox/django192/local/lib/python2.7
/site-packages/django/db/models/fields/related.py", line 567, in
resolve_related_fields
raise ValueError('Related model %r cannot be resolved' %
self.remote_field.model)
ValueError: Related model u'None.Model1' cannot be resolved
ERROR: InvocationError: 'django-
ticketing/ticket_26186_2/.tox/django192/bin/django-admin test'
ERROR: InvocationError: 'django-
ticketing/ticket_26186_2/.tox/django192/bin/django-admin test'
______________summary__________________________ __________
django189: commands succeeded
ERROR: django192: commands failed
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26186#comment:5>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.329bd086c7ed4973d6c87ef6630853db%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.