Closed PyB1l closed 4 years ago
I agree, but not instead of django forms. It should preferably support both server-rendered apps and API-centric DRF-apps.
django-service-objects uses the Django forms as a freebie way to get input validation. The service object should be disconnected from the UI since service-objects can be called for server-side, DRF, celery, or from inside another service-object.
For DRF, just instantiate and execute the service-object inside the Serializer's create
/update
methods. How do you see a tighter integration? A custom serializer? DRF fields?
A think your concept is really what default Django is missing. In fact, in serveral business-heavy django apps we have used something like your implementation. I think it should be very useful to support DRF serializers (instead of django forms), integrating with update, create methods.