Skip to content

Commit 5ea3cdc

Browse files
author
drinks
committed
fix: fix import_module
1 parent 625f613 commit 5ea3cdc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paraer/para.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import six
44
from functools import wraps
55
from uuid import uuid1
6-
from importlib import import_module
6+
from django.utils.module_loading import import_string
7+
78
from .datastrctures import Valid
89

910

@@ -94,7 +95,7 @@ def decorator(func):
9495
swagger = _doc_generater(itemset, func)
9596
data_method = default_data_method
9697
if getattr(settings, 'PARAER_DATA_METHOD', ''):
97-
data_method = import_module(settings.PARAER_DATA_METHOD) # 获取data的方法
98+
data_method = import_string(settings.PARAER_DATA_METHOD) # 获取data的方法
9899

99100
def wrapper(cls, request, *args, **kwargs):
100101
paramap = dict(kwargs)

0 commit comments

Comments
 (0)