Async QuerySet with Prefetch

2023-02-10 Thread 'Barry Johnson' via Django developers (Contributions to Django itself)
For those working on async code, I just opened a question on the Django Internals Async forum regarding query sets with prefetches, which aren't currently supported in the alpha build of 4.2. A solution seemed so surprisingly easy, I'm wondering what the real experts in the area would think.

Re: Inconsistent pagination when sorting by non-unique columns (ticket 34251)

2023-01-11 Thread 'Barry Johnson' via Django developers (Contributions to Django itself)
I'd be very much -1 if the framework modified my sorting parameters (by adding 'pk' at the end of the ordering). As mentioned, it can certainly break queries that can be handled by a covering index... but mostly because 'pk' isn't the field we would prefer to use in this case anyway. For ex

Re: Model-level validation

2022-10-07 Thread 'Barry Johnson' via Django developers (Contributions to Django itself)
I agree with James in several ways. Our large Django application does rather extensive validation of data -- but I would argue strongly against embedding that validation in the base instance.save() logic. (I would not argue against Django including a "ValidatingModel", derived from Model, tha