#26787: Access to deleted attribute triggers a query
-------------------------------------+-------------------------------------
Reporter: spectras | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 1.10
(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 timgraham):
The description of that PR gives an example of the behavior you describe:
One can also do the following after the patch:
{{{
obj = MyModel.objects.first()
del obj.field
obj.field # <- Loads the field from DB
}}}
so I'd say that yes, that's what Anssi intended. Whether or not there's
justification to change the behavior is another question, although the old
behavior seems untested and undocumented so backwards-compatibility likely
isn't extremely critical.
Could you explain your use case? Are there any ways to achieve it after
the change?
--
Ticket URL: <https://code.djangoproject.com/ticket/26787#comment:2>
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/066.d72de51bb704cdb202c534086da2c9b6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.