Skip to content

deprecate noload() option #11045

@zzzeek

Description

@zzzeek

this option was added as kind of a one-off about 18 years ago to suit an example case for custom loading of relationships which I'd never recommend today. because the option turns off the related attribute entirely, it has all kinds of not easily predictable behaviors, it returns essentially incorrect results (e.g. None when there would normally be a collection there) and we continue to get complaints about other features not working when it's used e.g. #11040.

The one place people use this is when they have some kind of serializer that touches every attribute and they dont want an attribute to load. I think that's a bad use case. They should do one of 1. dont have that relationship there if it isnt part of the object's state 2. get a serializer that can select for which attributes you want to serialize and which you dont 3. eagerly load the collection there. it's no different from an object with a relationship that has a huge list of related objects already loaded and you don't want to serialize that either.

so let's just deprecate it and we dont have to deal with complaints anymore, people will write better programs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingorm

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions