Ancestors

Written by valberg on 2024-08-29 at 21:36

So, validating and saving models instances in #Django. Shouldn't we just call Model.full_clean() from Model.save() as a default, and make it possible to skip with a skip_clean argument? Am I missing something? It feels like a big win and avoids the footgun aspect of forgetting to run full_clean.

=> More informations about this toot | More toots from valberg@social.data.coop

Toot

Written by Tim Schilling on 2024-08-29 at 22:07

@valberg What about when you're using a queryset.only('field_a'), then call instance.save('update_fields=['field_a'])?

=> More informations about this toot | More toots from CodenameTim@fosstodon.org

Descendants

Written by valberg on 2024-08-29 at 22:23

@CodenameTim I guess that would have the same effect as providing skip_clean.

=> More informations about this toot | More toots from valberg@social.data.coop

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113047585906332292
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
260.742494 milliseconds
Gemini-to-HTML Time
0.373564 milliseconds

This content has been proxied by September (ba2dc).