[Soc2014] Official meta API

Exactly, but this should be quite fast and only happens on runtime And in a
very specific situation. Do you think this can improve?

On Sunday, September 7, 2014, Collin Anderson <notifications@github.com>
wrote:

> In django/db/models/manager.py:
>
> > @@ -22,12 +22,12 @@ def ensure_default_manager(cls):
> >          setattr(cls, 'objects', SwappedManagerDescriptor(cls))
> >          return
> >      if not getattr(cls, '_default_manager', None):
> > -        # Create the default manager, if needed.
> > -        try:
> > -            cls._meta.get_field('objects')
> > +        # The apps registry will not be ready at this point. So
> > +        # we cannot use get_field().
> > +        if any(f.name == 'objects' for f in cls._meta.get_fields()):
>
> I assume we also can't use get_field_names because app registry is not
> ready?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/django/django/pull/3114/files#r17211625>.
>


-- 
*************

PirosB3

https://github.com/PirosB3