add default sorting for categories
This commit is contained in:
@@ -11,6 +11,8 @@ class Category(db.Model):
|
|||||||
texts = db.relationship(
|
texts = db.relationship(
|
||||||
'CategoryTexts', backref='category', lazy='dynamic')
|
'CategoryTexts', backref='category', lazy='dynamic')
|
||||||
|
|
||||||
|
__mapper_args__ = {'order_by' : name.asc()}
|
||||||
|
|
||||||
def path(self, locale='sv_SE'):
|
def path(self, locale='sv_SE'):
|
||||||
row = CategoryTreeI18n.query.filter_by(
|
row = CategoryTreeI18n.query.filter_by(
|
||||||
category_id=self.id, locale=locale).first()
|
category_id=self.id, locale=locale).first()
|
||||||
|
|||||||
Reference in New Issue
Block a user