Re: Model-level validation

2022-09-29 Thread Adrian Torres
Hi, Regardless of what you consider ModelForms to be, the fact that validation doesn't happen at the model level is very jarring if you've ever used any other MVC framework, it was and still is one of the major pet peeves of Django for me, to the point where we do something similar to what Uri

Re: Model-level validation

2022-09-29 Thread Aaron Smith
I would also like everyone to know, my objective in starting this thread is to get the go-ahead to open a PR for this. I would like to contribute back. On Thursday, September 29, 2022 at 6:30:32 PM UTC-7 Aaron Smith wrote: > How about a new class, `ValidatedModel`, that subclasses `Model` and

Re: Model-level validation

2022-09-29 Thread Aaron Smith
Carl, All ORMs I have worked with allow you to bypass validations when necessary. Sometimes you have to. But the path of greatest naivety should be as safe as possible. I cannot even imagine how many lost hours and economic damages have occurred because the easy path is the dangerous path. I

Re: Model-level validation

2022-09-29 Thread Aaron Smith
How about a new class, `ValidatedModel`, that subclasses `Model` and does nothing more than call `full_clean()` on `save()`? This would be completely backwards compatible, would clearly communicate what it does, and when documented right next to `Model` make it fairly obvious that Model is

Re: Model-level validation

2022-09-29 Thread Carl Meyer
On Thu, Sep 29, 2022 at 6:19 PM Curtis Maloney wrote: > On Thu, 29 Sep 2022, at 14:29, Aaron Smith wrote: > > Why doesn't Django validate Models on save()? > > > The short answer is: backwards compatibility. > > Model level validation hasn't always been a thing, with Django initially > depending

Re: Model-level validation

2022-09-29 Thread Curtis Maloney
On Thu, 29 Sep 2022, at 14:29, Aaron Smith wrote: > Why doesn't Django validate Models on save()? The short answer is: backwards compatibility. Model level validation hasn't always been a thing, with Django initially depending primarily on Form validation. Since it hadn't _always_ been there,

Re: Model-level validation

2022-09-29 Thread Aaron Smith
Yes, I did search, and I did not find an answer to my question. If one is always supposed to use a ModelForm, why isn't that ModelForm functionality part of the Model? On Thursday, September 29, 2022 at 1:04:17 AM UTC-7 carlton...@gmail.com wrote: > Hi. > > I have to ask, did you search the

Model-level validation

2022-09-29 Thread Aaron Smith
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

Re: Model-level validation

2022-09-29 Thread Aaron Smith
All I was able to find was that it was for "performance reasons", and I refuse to believe that a mature web framework like Django would prioritize performance (let's face it - even my millions-of-requests-per-day API service doesn't care about a few extra milliseconds here and there) over the

Re: git tag missing for django 4.1.1?

2022-09-29 Thread Mariusz Felisiak
Thanks for noticing, I added a missing tag. Best, Mariusz -- 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

git tag missing for django 4.1.1?

2022-09-29 Thread John Speno
Hi folks, According to the Django's release process document[1], there should be a signed tag for 4.1.1 yet I do not see it listed: https://github.com/django/django/tags Thanks. [1] https://docs.djangoproject.com/en/dev/internals/release-process/ -- You received this message because you are

Re: Model-level validation

2022-09-29 Thread אורי
אורי u...@speedy.net On Thu, Sep 29, 2022 at 11:04 AM Carlton Gibson wrote: > > 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

Re: Proposal: Add utility class "ClassList"

2022-09-29 Thread Carlton Gibson
Hey Jacob. Thanks for this. Can I ask you to give a few examples of potential usages in Django, and showing the gain over use a set in these cases? I'm trying to imagine exactly what you have in mind, but I'm not entirely clear. Thanks again. Carlton On Friday, 23 September 2022 at

Re: Model-level validation

2022-09-29 Thread Carlton Gibson
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