Don't fetch Field's choices on form/manipulator creation
|Reported by:||Owned by:||nobody|
|Cc:||Maniac@…, gabor@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
Currently creation of a default manipulator for a model causes actual fetching of all content of every related parent models which tends to be slow. They are used to fill <select>s created for ForeignKeys and ManyToManyFields but this may be unnecessary if those <select>s never rendered. This can be easily fixed by turning a method that gets choices for <select>s (Field.get_choices()) into a generator that will hit database only when (and if) needed.