Re: Using a lazy value in a queryset filter?

2022-06-17 Thread Sylvain
The form is used in a view, yes, like so: def objects_list(request): if request.method == "POST" and "delete" in request.POST: delete_form = MyForm(data=request.POST) if delete_form.is_valid(): if delete_form.cleaned_data["confirm"]: delete_form.sav

Re: Using a lazy value in a queryset filter?

2022-06-12 Thread Ryan Nowakowski
On Sun, Jun 12, 2022 at 11:46:44AM -0700, Sylvain wrote: > Hello, > > I’m trying to use the current language of the user in a queryset, but the > value gets resolved outside of the request-response cycle. I thought this > could work since querysets are lazy, but I guess that doesn’t make the >

Using a lazy value in a queryset filter?

2022-06-12 Thread Sylvain
Hello, I’m trying to use the current language of the user in a queryset, but the value gets resolved outside of the request-response cycle. I thought this could work since querysets are lazy, but I guess that doesn’t make the values they use lazy. Here’s an example of what I’m talking about: f