forked from VimPlug/jedi
Make sure py__get__ is applied properly for Django metaclasses
This commit is contained in:
@@ -189,7 +189,8 @@ class ClassMixin(object):
|
||||
mro.append(cls_new)
|
||||
yield cls_new
|
||||
|
||||
def get_filters(self, origin_scope=None, is_instance=False, include_metaclasses=True):
|
||||
def get_filters(self, origin_scope=None, is_instance=False,
|
||||
include_metaclasses=True, include_type_when_class=True):
|
||||
if include_metaclasses:
|
||||
metaclasses = self.get_metaclasses()
|
||||
if metaclasses:
|
||||
@@ -206,7 +207,7 @@ class ClassMixin(object):
|
||||
origin_scope=origin_scope,
|
||||
is_instance=is_instance
|
||||
)
|
||||
if not is_instance:
|
||||
if not is_instance and include_type_when_class:
|
||||
from jedi.inference.compiled import builtin_from_name
|
||||
type_ = builtin_from_name(self.inference_state, u'type')
|
||||
assert isinstance(type_, ClassValue)
|
||||
|
||||
@@ -154,7 +154,11 @@ def _new_dict_filter(cls, is_instance):
|
||||
if manager:
|
||||
return manager.name
|
||||
|
||||
filters = list(cls.get_filters(is_instance=True, include_metaclasses=False))
|
||||
filters = list(cls.get_filters(
|
||||
is_instance=is_instance,
|
||||
include_metaclasses=False,
|
||||
include_type_when_class=False)
|
||||
)
|
||||
dct = {
|
||||
name.string_name: DjangoModelName(cls, name, is_instance)
|
||||
for filter_ in reversed(filters)
|
||||
|
||||
Reference in New Issue
Block a user