I do this:
for i in Category.query.order_by(desc(Category.position)): print(i.name) I receive:
>>> Category3 >>> Category2 >>> Category1 If I do this:
zxc = {c.name: c.position for c in Category.query.order_by(desc(Category.position))} print(zxc) I get:
>>> {'Category1': 1, 'Category2': 2', 'Category3': 3} What can be wrong?
OrderedDictor something else - andreymal