Re: Adding "reason" to django.shortcuts.redirect

2023-08-07 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
This sounds reasonable, but unfortunately, it's backwards incompatible and so we cannot make the change. Any URL with a “reason” URL parameter would no longer be resolvable. You can make a project-specific shortcut function that allows providing the reason parameter. Since it’s two lines long,

Adding "reason" to django.shortcuts.redirect

2023-08-07 Thread Skrattoune
Hi, I've recently discovered the possibility to add a `reason` to a redirect. It's extremely useful for testing or debugging when a redirect to a same page can have different causes. I'm proposing to add this functionality to `django.shortcuts.redirect` : def redirect(to, *args, reason=None,

Re: Sync and Async versions of the same function: guidelines for contributors

2023-08-07 Thread Lufafa Joshua
Hi there, Just a quick assumption, code duplication could be the reason why the follow parameter and the _handle_redirects method was not implemented on the AsyncClient as per the ticket #34757, if my assumption is wrong, no big deal. Kind regards. On Sat, Aug 5, 2023 at 8:45 PM Jon Janzen

Disabling dark / light mode UI toggle

2023-08-07 Thread Niccolò Mineo
There is a specific situation in which I wouldn't want the user to be able to toggle between dark and light mode for the admin theme, and that is if I heavily customized it. I haven't found a way to disable that specific toggle, so I suggest that an *AdminSite.ui_toggle* (or the like) boolean

Re: Adding "reason" to django.shortcuts.redirect

2023-08-07 Thread 'Lily Foote' via Django developers (Contributions to Django itself)
> it's backwards incompatible and so we cannot make the change. Any URL with a > “reason” URL parameter would no longer be resolvable. I think if we decided this feature was sufficiently worthwhile, we could find a way to overcome the backward compatibility problem (a deprecation cycle, with

Re: Disabling dark / light mode UI toggle

2023-08-07 Thread Niccolò Mineo
* I haven't found a convenient way, that is. Il giorno lunedì 7 agosto 2023 alle 23:26:11 UTC+2 Niccolò Mineo ha scritto: > There is a specific situation in which I wouldn't want the user to be able > to toggle between dark and light mode for the admin theme, and that is if I > heavily

Re: Sync and Async versions of the same function: guidelines for contributors

2023-08-07 Thread Mariusz Felisiak
I also understand that the heavy lifting in async_to_sync and sync_to_async wrapper has been implemented and the hard work like thread affinity is managed by these wrapper. Switching between sync and async context is not

Re: Sync and Async versions of the same function: guidelines for contributors

2023-08-07 Thread Olivier Tabone
Hi Jon, Thank you for your input. Le samedi 5 août 2023 à 19:43:57 UTC+2, Jon Janzen a écrit : There are a few key things missing from core django before that's possible. Some of which are laid out in that forum thread I linked above, others are listed directly in the DEP like the ORM being

Re: Sync and Async versions of the same function: guidelines for contributors

2023-08-07 Thread Olivier Tabone
Le lundi 7 août 2023 à 14:43:26 UTC+2, Lufafa Joshua a écrit : Hi there, Just a quick assumption, code duplication could be the reason why the follow parameter and the _handle_redirects method was not implemented on the AsyncClient as per the ticket #34757, if my assumption is wrong, no

Re: Disabling dark / light mode UI toggle

2023-08-07 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
You should be able to disable the button by creating an empty admin/color_theme_toggle.html template in your project. On Mon, Aug 7, 2023 at 10:28 PM Niccolò Mineo wrote: > * I haven't found a convenient way, that is. > > Il giorno lunedì 7 agosto 2023 alle 23:26:11 UTC+2 Niccolò Mineo ha >