mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
Django-plugin related code is removed from stdlib-plugin.
This commit is contained in:
@@ -80,3 +80,16 @@ def _infer_field(cls, field):
|
|||||||
return DjangoModelField(value, field).name
|
return DjangoModelField(value, field).name
|
||||||
|
|
||||||
raise Exception('Should be handled')
|
raise Exception('Should be handled')
|
||||||
|
|
||||||
|
|
||||||
|
def get_metaclass_filters(func):
|
||||||
|
def wrapper(cls, metaclasses):
|
||||||
|
for metaclass in metaclasses:
|
||||||
|
if metaclass.py__name__() == 'ModelBase' \
|
||||||
|
and metaclass.get_root_context().py__name__() == 'django.db.models.base':
|
||||||
|
django_dict_filter = new_dict_filter(cls)
|
||||||
|
if django_dict_filter is not None:
|
||||||
|
return django_dict_filter
|
||||||
|
|
||||||
|
return func(cls, metaclasses)
|
||||||
|
return wrapper
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ This is not a plugin, this is just the place were plugins are registered.
|
|||||||
|
|
||||||
from jedi.plugins import stdlib
|
from jedi.plugins import stdlib
|
||||||
from jedi.plugins import flask
|
from jedi.plugins import flask
|
||||||
|
from jedi.plugins import django
|
||||||
from jedi.plugins import plugin_manager
|
from jedi.plugins import plugin_manager
|
||||||
|
|
||||||
|
|
||||||
plugin_manager.register(stdlib, flask)
|
plugin_manager.register(stdlib, flask, django)
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ from jedi.inference.filters import AttributeOverwrite, publish_method, \
|
|||||||
ParserTreeFilter, DictFilter
|
ParserTreeFilter, DictFilter
|
||||||
from jedi.inference.signature import AbstractSignature, SignatureWrapper
|
from jedi.inference.signature import AbstractSignature, SignatureWrapper
|
||||||
|
|
||||||
from . import django
|
|
||||||
|
|
||||||
|
|
||||||
# Copied from Python 3.6's stdlib.
|
# Copied from Python 3.6's stdlib.
|
||||||
_NAMEDTUPLE_CLASS_TEMPLATE = """\
|
_NAMEDTUPLE_CLASS_TEMPLATE = """\
|
||||||
@@ -792,13 +790,6 @@ def get_metaclass_filters(func):
|
|||||||
return [DictFilter({
|
return [DictFilter({
|
||||||
name.string_name: EnumInstance(cls, name).name for name in filter_.values()
|
name.string_name: EnumInstance(cls, name).name for name in filter_.values()
|
||||||
})]
|
})]
|
||||||
|
|
||||||
if metaclass.py__name__() == 'ModelBase' \
|
|
||||||
and metaclass.get_root_context().py__name__() == 'django.db.models.base':
|
|
||||||
django_dict_filter = django.new_dict_filter(cls)
|
|
||||||
if django_dict_filter is not None:
|
|
||||||
return django_dict_filter
|
|
||||||
|
|
||||||
return func(cls, metaclasses)
|
return func(cls, metaclasses)
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user