I was disappointed to see http://code.djangoproject.com/ticket/122
rejected. In the hopes that it may not be too late to change Adrian's
and Jacob's minds, I'd like to advance an argument in favor of
reversing that decision and accepting the patch.
The difference between:
class Person(meta.Model):
fields = (
meta.CharField('fname', maxlength=50),
meta.CharField('lname', maxlength=50),
meta.CharField('title', maxlength=50, blank=True, null=True),
meta.TextField('notes', blank=True, null=True),
)
and:
class Person(meta.Model):
fname = meta.CharField(maxlength=50)
lname = meta.CharField(maxlength=50)
title = meta.CharField(maxlength=50, blank=True, null=True)
notes = meta.TextField(blank=True, null=True)
is enormous from a usability standpoint. The former forces the user to
think "Oh yeah, I'm doing magic here", while the latter just feels
like writing a normal Python class.
The argument that there's too much "magic" going on behind the scenes
leaves me puzzled. Isn't there already lots of "magic" going on
setting up the assorted get_foo_list() functions for ForeignKeys and
ManyToManyFields? Why not add a little bit more "magic", when the
result is something that feels so much more Pythonic to the end user?
I guess what I'm asking for is a little bit more of a rationale for
rejecting the patch than just a single sentence about "too much
"magic" behind the scenes".
--
Robin Munn
[EMAIL PROTECTED]
GPG key 0xD6497014