-
Notifications
You must be signed in to change notification settings - Fork 297
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
Resolve resource type in serializer's meta class #1019
Comments
See discussion #1017 for more details. |
i experiment with the meta class implementation at my fork In principle that works - but i think we should rethink about the goal of moving the logic to the meta class creation, cause all serializers are configured on django start and at this point many tests have to become refactored. Maybe i can do that refactoring, but it will take a while. The easier way would be just to add the detail information on the |
In terms of API moving the logic of calculating relation resource type. I understand that this is not a easy and simple task. So for a quick fix I am happy to receive a PR which adds details to the |
Ok - i'll do it quickly. Is there any program workflow cheatsheet? I would do a docs enhancement in a separated issue if not. |
As DJA is a DRF extension the worklow is the same. Not sure whether there is a sketch like this for DRF but I guess it would make most sense to add to the upstream Django REST framework doc. Feel free to sketch something though and open a discussion about it. |
While we are at this, what do you think if we allowed serializers themselves to define what kind of type they are, via a function? |
I think this would match the |
I'm also thinking if we make |
utils.get_resource_type_from_serializer
is called several times throughout the DJA code base. When this method raises anAttributeError
it is a configuration/code setup issue and not a runtime issue. Besides there is no error message describing want went wrong.Goals:
get_resource_type_from_serializer
to serializer's meta classThe text was updated successfully, but these errors were encountered: