def get_all_related_objects_with_model(self, local_only=False,
                                           include_hidden=False,
                                           include_proxy_eq=False):
        """
        Returns a list of (related-object, model) pairs. Similar to
        get_fields_with_model().
        """
        try:
            self._related_objects_cache
        except __HOLE__:
            self._fill_related_objects_cache()
        predicates = []
        if local_only:
            predicates.append(lambda k, v: not v)
        if not include_hidden:
            predicates.append(lambda k, v: not k.field.rel.is_hidden())
        cache = (self._related_objects_proxy_cache if include_proxy_eq
                 else self._related_objects_cache)
        return [t for t in cache.items() if all(p(*t) for p in predicates)]
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/options.py/Options.get_all_related_objects_with_model