Ticket #18343 -- Cleaned up deferred model implementation #80

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
1 participant
@akaariai
Member

akaariai commented May 18, 2012

Removed some dead-code, and some dump logic in deferred field loading
and deferred model reduce(). The biggest user visible change is
that primary keys do not need fetching from the DB in some inheritance
cases.

All tests pass on SQLite.

[1/2] #18343 -- Cleaned up deferred model implementation
Generic cleanup and dead code removal in deferred model field loading
and model.__reduce__().
@akaariai

This comment has been minimized.

Show comment
Hide comment
@akaariai

akaariai May 22, 2012

Member

I splitted the patches into two for easier review.

Member

akaariai commented May 22, 2012

I splitted the patches into two for easier review.

[2/2] #18343 -- deferred model pk handling in inheritance case
Assuming an inherited model with parent_ptr_id -> id, doing a deferred
load and then fetching the id field would cause a database query, even
if the id field's value is already loaded in the parent_ptr_id field.
@akaariai

This comment has been minimized.

Show comment
Hide comment
@akaariai

akaariai May 27, 2012

Member

Pushed in manually

Member

akaariai commented May 27, 2012

Pushed in manually

@akaariai akaariai closed this May 27, 2012

sztrovacsek pushed a commit to sztrovacsek/django that referenced this pull request Mar 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment