On Feb 4, 2008 1:35 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm confused. Normally, you can access an inner class simply:

...snip...

> but this dosen't work with Admin:

That's because django.db.models.Model is not a "normal" class, and
hence no Django model class is; it has a metaclass which reaches in
and rearranges a lot of things to make your model work. What you want,
in the case of, say, User, is 'User._meta.admin'. The attribute
'_meta' on a model class is an instance of
django.db.models.options.Options, which contains all the
meta-information specified for the model (e.g., things from the inner
Meta class), and the attribute 'admin' in that is an instance of
django.db.models.options.AdminOptions, and contains the values from
the inner Admin class (though with newforms-admin that will finally be
decoupled).


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~---------~--~----~------------~-------~--~----~
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