#26787: Access to deleted attribute triggers a query
----------------------------------------------+--------------------
Reporter: spectras | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer (models, ORM) | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
This is a consequence of the implementation of #26207.
Now, all fields have a `DeferredAttribute` descriptor. This has the
consequence that this will trigger a model reload:
{{{
obj = MyModel.objects.get(pk=1)
del obj.title
obj.title
}}}
Up to version 1.9 (included), this code would raise an `AttributeError`.
Now it silently triggers a query to reload the field from the database.
Is this intended? If so, it should probably be added to the release notes.
--
Ticket URL: <https://code.djangoproject.com/ticket/26787>
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/051.8556d9f666ebee17c43aa45375356ece%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.