I've been taking a look at newforms-admin trying to integrate widget
media definitions (ticket #4418), and encountered a few problems with
the fieldset, fieldset_add, and fieldset_change methods on ModelAdmin.
These three fieldset methods are generators. This means when the
result of fieldset_add is provided to the constructor for AdminForm,
that AdminForm can only iterate over its fieldset once. To date, this
doesn't pose any problems - an AdminForm is a temporary object that is
only needs to be used once - but I need to iterate over the fieldsets
to do some pre-processing.
Is there any particular reason that the fieldset methods are
generators, rather than methods returning lists?
Yours,
Russ Magee %-)
There's no *great* reason behind it. I made those generators for the
standard "use generators" reasons -- more efficient, memory savings,
etc. If there is a compelling reason to change them to return lists,
and a solution with generators isn't possible, feel free to change it.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com