On Sep 19, 2005, at 3:21 PM, HBTaylor wrote:
For example, there are two tickets which come to mind
(http://code.djangoproject.com/ticket/337 and
http://code.djangoproject.com/ticket/338) which deal with things which
work correctly for firlds within admin but which don't for generic
views. There is a patch available for at least one of them, and the
discussion for these indicates that the admin classes are doing some
"magic" (note I didn't say "hacks"!) that isn't present to the
non-admin world.
That's only somewhat correct -- basically, the flatten/unflatten
functions that are now in the admin need to be refactored to be
methods of the manipulator, that's all. It's a bug, not a case of
"eating our own dog food". I'm really sorry this bug has taken so
long to fix; I've been turning in 70 hour weeks at work, and so I've
been less than excited about more Django hacking. I'll do my best to
get those fixes rolled in this week, but -- as always -- patches will
help.
As for the complexity of admin, there are INDEED places where it is
more complex than non-admin views. Enumerating the available tables,
available fields, etc., is beyond what a lot of non-admin views need.
However, if I'm going to place a field on a page (form field or
otherwise), it is probably good for adoption and expansion of the
framework to make it as little code as possible in the view and to
make
the code in the underlying classes as simple and straight-forward as
possible.
I agree 100%.
Jacob