Optionally using a custom queryset for Paginator and MultipleObjectMixin (ListView)

2018-06-29 Thread Jakub Kleň
Hi guys, I came across a problem today while testing my webapp with a full migrations applied from my legacy site for the first time. The problem is I'm using Prefetch in my view query (get_queryset), and it works fine when I just fetch it, but the problem comes with the .count() query which gen

Re: Optionally using a custom queryset for Paginator and MultipleObjectMixin (ListView)

2018-06-30 Thread Jakub Kleň
n to be able to strip the pages join when using > count() it certain conditions are met, and this might be preferable than > adding workarounds to various places. > > > On Fri, 29 Jun 2018, 22:00 Jakub Kleň, > > wrote: > >> Hi guys, I came across a problem today while

Re: Optionally using a custom queryset for Paginator and MultipleObjectMixin (ListView)

2018-06-30 Thread Jakub Kleň
unting, prefetches aren't actaully executed. Check the actual SQL > with e.g. django-debug-toolbar . > > On Fri, 29 Jun 2018 at 21:24, Jakub Kleň > > wrote: > >> Hi guys, I came across a problem today while testing my webapp with a >> full migrations a

Re: Optionally using a custom queryset for Paginator and MultipleObjectMixin (ListView)

2018-07-01 Thread Jakub Kleň
I checked MySQL 8 today, and it's the same story. Does anyone know how this performs in MariaDB or Postgresql? On Friday, June 29, 2018 at 11:00:33 PM UTC+2, Jakub Kleň wrote: > > Hi guys, I came across a problem today while testing my webapp with a full > migrations applied from

Make input field remove newlines from value

2018-11-01 Thread Jakub Kleň
I created this ticked today, and it got closed with a wontfix flag, but I still think it would be a good idea to implement: https://code.djangoproject.com/ticket/29912 The reason why it got closed is that django shouldn't modify the input like that, but the link which is mentioned in the respons

normalizing newlines in form fields

2018-11-12 Thread Jakub Kleň
I'm thinking if it wouldn't be nice if django automatically normalized newlines of data entered by the user. The implementation would be really simple, there's already a function for it in django.utils.text.normalize_newlines, and it would go into django.forms.fields.CharField.to_python the sam

Re: normalizing newlines in form fields

2018-11-12 Thread Jakub Kleň
onday, November 12, 2018 at 3:58:39 PM UTC+1, Jakub Kleň wrote: > > I'm thinking if it wouldn't be nice if django automatically normalized > newlines of data entered by the user. The implementation would be really > simple, there's already a function for it in > django.ut

Re: normalizing newlines in form fields

2018-11-12 Thread Jakub Kleň
uring implementation. On Monday, November 12, 2018 at 3:58:39 PM UTC+1, Jakub Kleň wrote: > > I'm thinking if it wouldn't be nice if django automatically normalized > newlines of data entered by the user. The implementation would be really > si

Re: normalizing newlines in form fields

2018-11-12 Thread Jakub Kleň
>From what I have read so far, it would be probably better to normalize to '\r\n'. On Monday, November 12, 2018 at 3:58:39 PM UTC+1, Jakub Kleň wrote: > > I'm thinking if it wouldn't be nice if django automatically normalized > newlines of data entered by the u