On Fri, Sep 23, 2011 at 4:46 PM, sebastien piquemal <seb...@gmail.com> wrote:
> Hi all !
>
> So this might be a stupid idea, or it might have been answered
> before ... actually it seems so obvious to me that you have probably
> thought of it before and rejected it !!! But let's try ...
>
> I was wondering, why isn't there a user API for introspecting models ?
>
> OK, there is an API, through '_meta', which is not documented (unless
> you read the source), which is not addressed to users, and is
> therefore likely to change, and therefore unreliable.

See https://code.djangoproject.com/ticket/12663

_meta is in a weird limbo state. It isn't *technically* stable API,
and it isn't documented, but it's *effectively* a stable API -- both
because it hasn't changed in a long time, and there is lots of code in
the wild that would break hard if we changed it.

So - it's one of those things that *should* be documented and
fomalized; it's just waiting on someone with the spare time to do the
job.

There's also a light cleanup required. There are some parts of the
_meta api -- like get_field() -- that are completely uncontroversial,
and would clearly be stabilized as is. However, there are also API
entry points that are more esoteric, and in some cases, are represent
potentially duplicated functionality in the _meta structure. What is
needed is for a motivated someone to do an audit, cleanup, and
documentation of the code that is there.

Yours,
Russ Magee %-)

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

Reply via email to