simplepro 模型继承的类 还是一直报错!

作者:zhc1208420887 306 浏览 5 评论 发布时间:2019-12-19 14:44:49

没有数据也报错

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/views/debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/views/debug.py", line 333, in get_traceback_html
    c = Context(self.get_traceback_data(), use_l10n=False)
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/views/debug.py", line 264, in get_traceback_data
    frames = self.get_traceback_frames()
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/views/debug.py", line 422, in get_traceback_frames
    filename, lineno, 7, loader, module_name,
  File "/home/xftm/.virtualenvs/evn_django/lib/python3.6/site-packages/django/views/debug.py", line 383, in _get_lines_from_file
    context_line = source[lineno]
IndexError: list index out of range

Loading...
评论列表 5条评论
社区小助手
2020-05-04 18:14:50

升级到最新版即可,已经修复。@zhc1208420887

zhc1208420887
2020-05-04 18:14:49

@simplepro


 list_display = (
        'id',
    )
    list_filter = (
     ‘id’
    )
    show_full_result_count = False
    list_per_page = 15
    list_display_links = None
    list_editable = []
    ordering = ['id']
    search_fields = ('id',)
社区小助手
2020-05-04 18:14:49

麻烦贴下admin的代码

zhc1208420887
2020-05-04 18:14:49

去掉ordering就可以了

A server error occurred. Please contact the administrator. 双击编辑的提示

@simplepro

社区小助手
2020-05-04 18:14:49

Python3.7+ simplepro最新版试试