Re: Should ModelChoiceIterator cache its QuerySet?

2018-04-10 Thread Carlton Gibson
Hi François, Thank you for a good write-up of the issue. Having looked at this from each direction I can't see a way of squaring all the desires here. I see the possibility of an inconsistency between the __len__() and __iter__() calls. This would certainly be nice to avoid but I'm not sure

Should ModelChoiceIterator cache its QuerySet?

2018-04-02 Thread François Freitag
Hi, I'm having mixed feelings toward ModelChoiceIterator's implementation. That custom iterator intends to fetch choices defined by the queryset argument of a ChoiceField. Issue = Currently, the expectation seems to be that the latest data is queried from the database each time the choices