Re: Proposal: Check constraints at the model field level

2023-04-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Mariusz, I agree with the burden, but it should be noted that SQL has both CHECK on the field and table level, and CheckConstraint only defines table-level constraints. This is not true for unique constraints or indices. Also, what do you think of a way for custom field classes to add constraints,

Re: Proposal: Check constraints at the model field level

2023-04-05 Thread Mariusz Felisiak
Hi, This proposal is not really nice from a maintenance point of view as we will end with the same complicated situation we currently have with uniqueness checks or indexes i.e. many ways to define the same: - Field.unique/index - Meta.unique_together/index_together - Meta.constraints/indexes

Stalebot on djangoproject.com issues

2023-04-05 Thread Tim Graham
Hello, In October 2022, a stalebot was activated for djangoproject.com issues: https://github.com/django/djangoproject.com/issues/1219 https://github.com/django/djangoproject.com/pull/1220 It comments on an issue if there's no activity in the last six months: "This issue has been automatically

Re: Proposal: Check constraints at the model field level

2023-04-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I agree this feature would be useful, at least to allow bundling check constraints with custom field classes. As you point out the PositiveIntegerField classes do this within Django, and doubtless many custom fields have used the db_check() method. The only thing I'm not a fan of in your proposal

Proposal: Check constraints at the model field level

2023-04-05 Thread David Sanders
Hi folks, We've had check constraints for a while now and they're awesome. I'd like to propose an alternative way to declare check constraints: at the field level. This sounds like it's duplicating the feature but there are some advantages that make this distinct from declaring at the model-level

Re: Issue with get_FOO_display not working in Django admin

2023-04-05 Thread David Sanders
At this point I'll let others chime in with their opinion on whether this is something that needs to change because: 1. I rarely use admin 2. I've never really had the need to override a choice's display over those supplied via `choices` :) On Wed, 5 Apr 2023 at 19:05, 'Ibrahim Abou Ele

Re: Issue with get_FOO_display not working in Django admin

2023-04-05 Thread 'Ibrahim Abou Elenein' via Django developers (Contributions to Django itself)
Isn't this some sort of duplication? why not just use it instead of writing its logic again? On Wednesday, April 5, 2023 at 7:12:48 AM UTC+2 David Sanders wrote: > Hi Ibrahim, > > get_FOO_display() isn't intended to be overridden like that, it's just a > convenience method for use in templates/w