Warning in documentation about filtering queryset in ClassBasedViews

2022-10-29 Thread Daniel Gayoso González
Hello, Following the example in https://docs.djangoproject.com/en/4.1/topics/class-based-views/generic-display/#viewing-subsets-of-objects I tried the following class BookListView(ListView): model = Book queryset = Book.objects.filter(publication_date__lte=timezone.now()) I found that th

Proposal: filter by multiple values, case-insensitive

2022-10-29 Thread Jeremy Nauta
Hi all, I'd like to propose a new django filter: *__iin*. As the name implies, this filter finds results that match one of the given values, ignoring case. In other words, this is a hybrid of *__in *and *__iexact*. It surprises me that there are filters for* qs.filter(field__iexact='text')* , *q

Re: #21978 include production-ready web server

2022-10-29 Thread Peter Baumgartner
Thanks for the thorough review Florian! Some comments inline... On Wed, Oct 26, 2022 at 1:30 AM Florian Apolloner wrote: > Hi Pete, > > this does look interesting. And I agree that this is something that would > be nice to have in core in one form or another. That said I think we have > to do it

Re: #21978 include production-ready web server

2022-10-29 Thread Peter Baumgartner
You don't get typing out-of-the-box with straight environment variables. Handling things like booleans can be tricky. You probably want to handle "True", "true", "1", "yes", etc. Naive implementations can do the wrong thing silently and introduce a major security hole (accidentally using DEBUG=True

Re: Proposal for Django Core Sprints

2022-10-29 Thread Ed Rivas
I think this could open up another way in which companies could get involved in the development of Django by acting as a Sprint Sponsor. This could include providing a venue and/or funding for travel and lodging costs. Having a list of features that need to be sprinted on could attract companie

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-10-29 Thread Adam Taylor
What about having a setting that is used in the django/core/files/images.py file's get_image_dimensions function? Something like IMAGE_DIMENSIONS_USES_EXIF. It could default to False at first to maintain backwards compatibility and eventually could be True by default. If the setting is set to T

Re: Warning in documentation about filtering queryset in ClassBasedViews

2022-10-29 Thread David Sanders
Hi Daniel, I don't think a warning is necessary here as it's fairly standard Python. To explain: the timezone.now() is evaluated at module level – ie only once when the Python module is imported – which explains the behaviour that you're experiencing. If you like you can submit a documentation P

Re: Warning in documentation about filtering queryset in ClassBasedViews

2022-10-29 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I'm inclined to agree with David here. This is a “understanding Python” thing. We can’t feasibly add documentation warnings everywhere such a mistake could be made. On Sat, Oct 29, 2022 at 8:00 PM David Sanders wrote: > Hi Daniel, > > I don't think a warning is necessary here as it's fairly stan

Re: #21978 include production-ready web server

2022-10-29 Thread Peter Baumgartner
On Sat, Oct 29, 2022 at 10:06 AM Peter Baumgartner wrote: > Thanks for the thorough review Florian! Some comments inline... > > On Wed, Oct 26, 2022 at 1:30 AM Florian Apolloner > wrote: > >> Hi Pete, >> >> this does look interesting. And I agree that this is something that would >> be nice to h

Re: #21978 include production-ready web server

2022-10-29 Thread 'Tobias McNulty' via Django developers (Contributions to Django itself)
Hi Pete, A pluggable backend sounds like a good idea. Regarding DJANGO_ENV, why not ship the template with two settings files and use the existing DJANGO_SETTINGS_MODULE, instead of adding a new environment variable? Maybe that would be controversial too, I'm not sure, but perhaps less so than i