On 9/19/05, Jacob Kaplan-Moss <
ja...@jacobian.org> wrote:
>
>
> On Sep 19, 2005, at 11:39 AM, Robert Wittams wrote:
> > Well, I'm not an author of the framework, but the admin code is very
> > hard to understand (imo). I'm sure the authors understand it fine, but
> > for open source to instill confidence clarity is key. The admin view
> > should be a great example to django users, but unfortunately right now
> > it isn't.
>
> No, it shouldn't -- the admin views are incredibly complex because
> the admin interface is incredibly complex. Public views are almost
> always going to be much much simpler. Even if the admin views get
> cleaned up -- which they should be, of course -- they still won't be
> a very good example. You wouldn't tell someone to read the Linux
> kernel source to learn how to program in C; the admin views should be
> thought of the same way.
I think I know where people are coming from. When I first started
playing with Django, I was frustrated that there were no examples on
how to leverage the admin into my webapp. But, once I looked at the
code and read some of the tutorials it dawned on me that the admin
stuff was NOT to leveraged by my webapps. Once I accepted this, I
became very content with letting the admin code stay behind the
curtain and concentrated on building my site using the standard set of
tools.
I think most new developers to Django will go through this thought
process and either accept things the way they are or get frustrated
and move on to another framework.
So, I offer 3 suggestions:
1. Make it more clear that the admin tool is really a separate
applications and cannot really be leveraged into new apps easily. This
should be done in that first admin tutorial.
2. I really think the admin tool is very slick and it really is a
differentiator for Django. I also understand some serious wizardry and
magic went into making it, so once 1.0 is finished and in the can, I
would suggest looking at the Admin tool as the guide for future
enhancements or versions of the software. I would love to see the key
admin components (such as the auto data tables, filters, search, and
forms) abstracted in such a way that any app could use them easily. To
me, this would be another layer of Rapid App Development on top of
generic views that would make this framework even more productive
(especially for quick-and-dirty CRUD sites).
3. This last item is really out there... But, to me it would be nice
if the admin tool could be decoupled from the ORM library (using
interfaces, adapters and pyprotocols?), that way people could create
adapters for SQLObject or any other ORM tool and they wouldn't lose
out on using the Admin console. While I am very content with the ORM
library, a lot people might not use Django if it cannot play nice with
their existing models.
Sorry for contributing just ideas at this time... I hope I can start
contributing patches as I get comfortable with the actual code behind
the framework.
thanks again for the great framework,
ian