#20143: Lazy loading of related fields does not work for non-loaded models
-------------------------------------+-------------------------------------
Reporter: andreas_pelme | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.5
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by andreas_pelme):
I think the workaround in the shell management command just makes this
much worse since things seems to be working when playing in the shell.
runserver (and all management commands which uses model validation) also
makes this a non-problem, since the model-validation forcefully loads all
models modules).
This means that when this actually becomes an issue, it will probably be
in production. I did a quick test with `python manage.py runserver` vs
`gunicorn lazy_model_loading.wsgi` and the same models and this urlconf:
{{{
from django.conf.urls import patterns
from django.http import HttpResponse
from foo.models import Foo
urlpatterns = patterns('', ('', lambda request:
HttpResponse(unicode(Foo()))))
}}}
This runs just fine with runserver, but crashes with gunicorn.
--
Ticket URL: <https://code.djangoproject.com/ticket/20143#comment:4>
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].
For more options, visit https://groups.google.com/groups/opt_out.