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

deprecate noload() option #11045

Open
zzzeek opened this issue Feb 21, 2024 · 0 comments
Open

deprecate noload() option #11045

zzzeek opened this issue Feb 21, 2024 · 0 comments
Labels
bug Something isn't working orm
Milestone

Comments

@zzzeek
Copy link
Member

zzzeek commented Feb 21, 2024

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.

@zzzeek zzzeek added bug Something isn't working orm labels Feb 21, 2024
@zzzeek zzzeek added this to the 2.1 milestone Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working orm
Projects
None yet
Development

No branches or pull requests

1 participant