add default sorting for categories

This commit is contained in:
Martin
2016-08-16 17:20:48 +02:00
parent 4aa8a6a7e3
commit e65be51741
+2
View File
@@ -11,6 +11,8 @@ class Category(db.Model):
texts = db.relationship(
'CategoryTexts', backref='category', lazy='dynamic')
__mapper_args__ = {'order_by' : name.asc()}
def path(self, locale='sv_SE'):
row = CategoryTreeI18n.query.filter_by(
category_id=self.id, locale=locale).first()