-
Notifications
You must be signed in to change notification settings - Fork 266
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
django-mongoengine basic compatibility #200
Comments
hi @last-partizan, yes that's an ugly hack for sure. 😄 so initially the purpose of this line was to make sure the assumptions hold and there is no crazy usage with hard to understand stacktraces. at the time i was not aware of alternate model implementations. yes i think this could be changed with little impact. the question i ask myself is whether this one line will be sufficient to support I'm not sure if you noticed the According to this PR it looks like other things need to (slightly) change too. I see you are the maintainer of |
@tfranzel no, i didn't noticed that PR. Looks nice. But, that's for raw I am maintaining I'm using raw Serializers, with custom save/update methods, so for my case, just changing that line would be enough. And adding some methods like |
No need for any changes, i subclassed AutoSchema instead of my ugly hack. |
i'm glad the PR pointed you in the right direction. if you have trouble down the line, we can certainly can come back and do the change. |
Hi, i'm trying to use drf-spectacular with django-mongoengine, and this line of code is getting in the way:
drf-spectacular/drf_spectacular/openapi.py
Line 353 in 05e4b90
I must write ugly monkey-patching to get around of this.
Could you please change this check, to something like
looks_like(model_field)
?Something like
hasattr(model_field, "get_internal_type")
would do, if this check is really required. But, for me it works fine without it. Maybe even just delete that line?I can write PR if you suggest changes. Or maybe you can suggest less ugly way to fool isinstance.
The text was updated successfully, but these errors were encountered: