sys.path.insert(0,BASE_DIR)
,
sys.path.insert(0,os.path.join(BASE_DIR, "db_tools"))
sys.path.insert(0,os.path.join(BASE_DIR, "apps"))
sys.path.insert(0,os.path.join(BASE_DIR, "extra_apps"))
from goods.models import Goods
:
python models.py:
Traceback (most recent call last):
File "models.py", line 6, in
ModuleNotFoundError: No module named "goods"
django,2.0setting.pyINSTALLTED_APPS
`"
Return the django-filters `FilterSet` used to filter the queryset.
"""
filter_class = getattr(view, "filter_class", None)
filter_fields = getattr(view, "filter_fields", None)
if filter_class:
filter_model = filter_class.Meta.model ...
assert issubclass(queryset.model, filter_model), \
"FilterSet model %s does not match queryset model %s" % \
(filter_model, queryset.model)
return filter_class
Local vars`