Hi. I have to ask, did you search the history at all here? This has been discussed *several times* over the years.
> Bringing View-level concepts such as forms down into celery tasks and management commands breaks separation of concerns... I think it's an error to think of forms (please read "or serializers" throughout) as "view-level". A view's job is to turn requests into responses. It may use other layers of Django, such as the ORM to do that, but that doesn't make said layers part of the view. (The ORM is not "view-level".) Forms are such another level. Their role is to validate (and transform) incoming data, and they provide an opportunity to present user-friendly validation errors back up to the client code. You should definitely be using them in all places that you process incoming data, and that includes celery tasks. On Thursday, 29 September 2022 at 06:29:30 UTC+2 aa...@aaronsmith.co wrote: > Why doesn't Django validate Models on save()? > > I am aware that full_clean() is called when using ModelForms. But most web > app development these days, and every django app I've ever worked with, are > headless APIs. The default behavior is dangerous for the naive developer. > > Bringing View-level concepts such as forms or serializers down into celery > tasks and management commands breaks separation of concerns, and having > multiple validation implementations at different layers in the app is > fraught with divergence and unexpected behavior. > > It's not right. The data store layer should protect the validity of the > data. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/566b4706-4075-485b-9122-eca24d3b67fcn%40googlegroups.com.