Kaynağa Gözat

reorder resources by name

joel
Simon Bowie 1 yıl önce
ebeveyn
işleme
96520b6244
3 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

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

Yükleniyor…
İptal
Kaydet