-
Notifications
You must be signed in to change notification settings - Fork 311
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
Regression in 3.5 - AttributeError: type object 'Meta' has no attribute 'model' #757
Comments
The fix should be pretty easy by gating both |
Makes sense, and sorry about the regression. Seems that despite the test coverage, it's actually hard to change this code much. I don't use DRF, so I hope that someone else will fix this. Would be happy to do a patch release. |
And thanks for reporting so quickly 👍 |
Fixes django-money#757 from original regression caused by django-money#722
@benjaoming loved how easy it was to contribute!! Candidate fix at #758. |
Nice to avoid this crashing with a simple change, but is a Meta class outside of using a model serializer even valid/meaningful code in drf? Is it not only used to define how to auto-generate a serailizer class from a model? |
@stianjensen yes, there are multiple examples from the DRF docs like multi-field validators. Also consider inheritance, where maybe a parent serializer class declares some fields as read only and a subclass declares them as not (or vice-versa). |
Looks to be caused by #722.
Django - 4.2.11
DRF - 3.14.0
I think this is an edge case when using a
MoneyField
with aMeta
and outside of aModelSerializer
.ModelSerializer
is the only case where amodel
is used in DRF.This should be the reproduction case:
The text was updated successfully, but these errors were encountered: