Re: Cache a ModelChoiceField queryset in a FormSet

2018-04-06 Thread jxrossel
Since nobody gave a feedback, let me provide a link to the solution I came up with, in case anybody is interested: https://stackoverflow.com/a/49689142/2775385 Le mercredi 28 mars 2018 07:41:34 UTC+2, jxro...@gmail.com a écrit : > > Hi, > > I am using a ModelChoiceField in a simple FormSet (not

Cache a ModelChoiceField queryset in a FormSet

2018-03-27 Thread jxrossel
Hi, I am using a ModelChoiceField in a simple FormSet (not a ModelFormSet). When rendering the FormSet, Django duplicates the ModelChoiceField queryset for each row of the FormSet and repeats the same query multiple times to fill the select boxes. Is there a standard solution to cache the

How to set default css classes for all built-in form widgets

2016-12-25 Thread jxrossel
Merry Christmas to you ! Short version: is it possible to define a set of default css classes that Django should use whenever rendering a form ? Long version: The context is as follows: I would like to use the css classes defined in the w3.css framework for all my forms (