Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #18306 -- Defer and update_fields interaction. #213

Closed
wants to merge 2 commits into from

Commits on Jul 16, 2012

  1. Fixed #18306 -- Made deferred models issue update_fields on save

    Deferred models now automatically update only the fields which are
    loaded from the db (with .only() or .defer()). In addition, any field
    set manually after the load is updated on save.
    Andrei Antoukh authored and akaariai committed Jul 16, 2012
    Copy the full SHA
    123dde0 View commit details
    Browse the repository at this point in the history
  2. Polished update_only and defer() interaction

    The biggest changes are:
      - a bugfix to select_related handling
      - a bugfix for shared ._state.deferred_fields for instances loaded
        through the same queryset.
      - some code cleanup related to field.name <> field.attname handling
      - documentation polish
    
    The bugfixes were done by getting totally rid of ._state.deferred_fields
    and instead relying on inspecting the instance's __dict__ and
    __class__.__dict__ for deferred field information on save.
    
    Refs #18306.
    akaariai committed Jul 16, 2012
    Copy the full SHA
    d2f21c8 View commit details
    Browse the repository at this point in the history