You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to suggest making one BaseAPIView at least for CRUD models
For example you can see it in CurrencyAPIView
If there are many models, there will be a lot of code duplication
Why not do it like this
Thank you for your suggestion! Your idea of creating a BaseAPIView to reduce code duplication for CRUD operations is excellent. This approach would indeed simplify the code and make it more maintainable.
Implementation Plan
This class will handle the common CRUD logic for all models.
It will use generics and dynamic attributes to allow customization for each specific model.
Update the CurrencyAPIView to use BaseAPIView:
This class will inherit from BaseAPIView and set the required serializers and use cases.
With these changes, any new API view for CRUD operations can inherit from BaseAPIView and define its own serializers, use cases, and input DTOs, significantly reducing code duplication.
Please let me know if you have any questions or further suggestions!
I would like to suggest making one BaseAPIView at least for CRUD models
For example you can see it in CurrencyAPIView
If there are many models, there will be a lot of code duplication
Why not do it like this
After that, we don't have to write a CRUD for the models every time like this:
The text was updated successfully, but these errors were encountered: