Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use peewee can't sort by fields #1688

Open
axiaoxin opened this issue Aug 7, 2018 · 0 comments
Open

use peewee can't sort by fields #1688

axiaoxin opened this issue Aug 7, 2018 · 0 comments
Labels

Comments

@axiaoxin
Copy link

axiaoxin commented Aug 7, 2018

Traceback (most recent call last):
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/gunicorn/workers/base_async.py", line 56, in handle
    self.handle_request(listener_name, req, client, addr)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 160, in handle_request
    addr)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/gunicorn/workers/base_async.py", line 107, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/werkzeug/contrib/fixers.py", line 152, in __call__
    return self.app(environ, start_response)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask_admin/base.py", line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask_admin/base.py", line 368, in _run_view
    return fn(self, *args, **kwargs)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask_admin/model/base.py", line 1882, in index_view
    view_args.search, view_args.filters, page_size=page_size)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask_admin/contrib/peewee/view.py", line 399, in get_list
    query, joins = self._order_by(query, joins, sort_field, sort_desc)
  File "/data/playground/projects/zhiyun_notifer/deploy/venv/lib/python2.7/site-packages/flask_admin/contrib/peewee/view.py", line 324, in _order_by
    if sort_field.model_class != self.model:
AttributeError: 'DateTimeField' object has no attribute 'model_class'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants