On Oct 25, 10:38 am, Dan Ellis <[EMAIL PROTECTED]> wrote:
> Yeah, Django is doing some magic using a metaclass for Model
> (ModelBase, which is badly named IMO, as it isn't Model's base class).
> Most of the magic is in django.db.models.base.
>
> The documentation tells you how to /use/ the model API, though. I
> don't think there's any need for the docs to explain what magic is
> being done; in fact, it would just be very confusing to most users.

The user docs don't need to explain *how* the magic is done, but it
would save a lot of head-scratching if they simply mentioned that a
small bit of magic is indeed being done.

The way it stands, a new user reads through the tutorial, starts
making things work, and then says, "waaaaaaaait just a minute....
what's going on here? I've been referring to instance variables here
all along, but I defined them as class variables in my model. Did I
miss something somewhere?".

It would be trivial to just add a short sentence in the tutorial
saying something like, "Behind the scenes, Django sets things up such
that you automatically get instance variables for each of the class
variables you've set up.". Small price to pay for removing some
mystery, IMO.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to