Sort department associations by name, by default.

This commit is contained in:
Lance Edgar 2016-01-30 15:11:22 -06:00
parent be2f7dd241
commit b5d073fe2b

View file

@ -163,6 +163,7 @@ class EmployeeDepartment(Base):
department = orm.relationship(
Department,
order_by=Department.name,
backref=orm.backref('_employees', cascade='all, delete-orphan'))
Employee.departments = association_proxy(