瀏覽代碼

reorder resources by name

joel
Simon Bowie 1 年之前
父節點
當前提交
96520b6244
共有 3 個檔案被更改,包括 6 行新增0 行删除
  1. +2
    -0
      web/app/book.py
  2. +2
    -0
      web/app/practice.py
  3. +2
    -0
      web/app/tool.py

+ 2
- 0
web/app/book.py 查看文件

@@ -31,6 +31,8 @@ def get_books():
else:
kwargs = {'type': type, key: request.args.get(key)}
books = Resource.query.filter_by(**kwargs).all()
# reorder books by book name
books = sorted(books, key=lambda d: d.__dict__['name'])
# get number of books
count = len(books)
if view != 'list':

+ 2
- 0
web/app/practice.py 查看文件

@@ -21,6 +21,8 @@ practice = Blueprint('practice', __name__)
def get_practices():
view = request.args.get('view')
practices = Resource.query.filter_by(type='practice').all()
# reorder practices by practice name
practices = sorted(practices, key=lambda d: d.__dict__['name'])
# get number of practices
count = len(practices)
if view != 'list':

+ 2
- 0
web/app/tool.py 查看文件

@@ -34,6 +34,8 @@ def get_tools():
else:
kwargs = {'type': type, key: request.args.get(key)}
tools = Resource.query.filter_by(**kwargs).all()
# reorder tools by tool name
tools = sorted(tools, key=lambda d: d.__dict__['name'])
# get number of tools
count = len(tools)
if view != 'list':

Loading…
取消
儲存