-
Notifications
You must be signed in to change notification settings - Fork 87
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
Use of Django Rest frameworks serializers? #1001
Comments
Hi @Charlisim - thanks for checking out Opal and for getting in touch ! I know what you mean about use of DRF Serializers - me and @fredkingham have discussed this before :) The reason we are where we are is that our I think there's definitely a case for moving the serialization into a DRF style serializer/renderer. The potential complexities are probably less to do with bulk updates, and more to do with some of the more esoteric use cases. There are some use cases where we override these methods quite extensively to implement unusual and complex requirements - for conditional logic related to values in the data, interactions with other models et cetera. We'd want to make sure that you didn't have to hand-code a serializer for every model - that they were generated for you by default, but also that you could easily override serialize/update methods for individual subrecords. It's really useful to hear that you found this weird - we definitely appreciate this kind of feedback :) At this stage, I suspect that we're unlikely to get around to this particular refactoring very soon - but we'd happily merge a PR that refactored the serialization to use DRF style serializers ! Is the refactor something you might be interested in doing? Also - are you thinking of using Opal for a project in particular or just exploring ? |
I can do the refactor, but as you'll understand will take some time to refactor all the project, but I think is something that can help me to get used with all the internals of the project. I'm exploring the possibilities that the project have to be implemented in a clinic of Neurology that may be will open in Guatemala in a couple of years. |
@Charlisim Sounds great and an exciting potential project! It's always good to hear how people are using Opal :) Do feel free to get in touch if you want to talk things over or have any questions etc - either here or on the mailing list: https://groups.google.com/forum/?ohc-dev#!forum/ohc-opal |
I'm starting to get used with the project and after making other projects in django I feel weird not use Django Rest framework serializers for REST API. The only thing that I realized that may be can't be achieved out of the box with DRF serializers is bulk updates. There is any other reason to not use them?
I think that can improve the API and separate logic, not having view logic on the model.
The text was updated successfully, but these errors were encountered: