-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Models are now parsed before checking if they exist in a collection #3766
Conversation
Instantiating models can also have side effects. I don't think we want to create extra ones just for the |
The only case where a model is instantiated early and subsequently only used for its parsed attributes is when the model is already in the collection, but the Certainly though I could be missing something; if you could provide a failing test case that illustrates your concerns, that'd be really helpful. |
This is how we used to do it, actually (#2249 and others). It's unexpected behavior, and a real pain to manage, when you start creating temporary models willy-nilly. |
70ebdae
to
4e7e717
Compare
From my perspective, the unexpected behavior is that Sure, creating models 'willy-nilly' is bad. This creates a model in a very specific case that is currently unhandled. I guess I'd like to see a concrete example of how things could go wrong if this code was merged? |
Sure, and I hear ya. But there's a better way of fixing this than creating temporary models just to get their Thanks for your feedback and help on this so far. Let's try and get #3758 to a good state that fixes your use case. |
@akre54 The I'm all for a clean fix for this in v2; I already left feedback on #3758 last week. But V2 still feels pretty far out. I think this can be fixed in a backwards compatible way, do you disagree? |
Line 856 says differently. If In your test case, you could use |
@akre54 Not quite. If However, the way Do you see why, in both |
Regarding |
Yeah it's not the cleanest or clearest solution to have to duplicate logic between |
See issue #3760