On Wednesday 17 August 2005 06:06 pm, Robin Munn wrote:
> 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 would even say that this is very little 'magic' for what is accomplished.  I 
think that it just _looks_ scary, because it uses inspect.  However, the 
usage of inspect is mainly for redundancy, in order to better catch breakage.

I know that the patch is almost 1000 lines long, but over 90% of that is just 
converting the models used internally and in the test framework.  The meat of 
it is in lines 375-404 and 552-569 of model_api.r.389.diff.  (which is 
attached to the ticket.)

As what I did in this patch really doesn't need to be ingrained into django 
itself, I was intending to move it into a wrapper class this evening.  This 
would allow the use of this new syntax without requiring any change to 
django,  so those who really want the new syntax can have it.  Unfortunately, 
this would not be something which a new django user would see, and I think 
that a first 'wow' impression is one of the advantages of this new syntax.

MWM

Reply via email to