@@ -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': |
@@ -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': |
@@ -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': |