Skip to content

Conversation

TonisPiip
Copy link

Had a nasty issue where I had a large QS be a @class_property, and this code caused it to eval the QS, there's no need to eval it, just pass it directly do isinstance, if we really want a check, a is not None would be better.

But would be even better if this didn't loop over all properities, rather it used

cls._meta.related_objects

@TonisPiip
Copy link
Author

cls._meta._get_fields(reverse=True, forward=False) would be a better option,

I've swtiched to using class_method to avoid this issue, but this was a nasty surprise. :( a warning about using class_property in the docs would be good.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant