def get_collection_items(self, ascending=False):
#TODO, is this still needed with self.collection_items being available?
- order_col = MediaEntry.created
+ order_col = CollectionItem.position
if not ascending:
order_col = desc(order_col)
- return CollectionItem.query.join(MediaEntry).filter(
- CollectionItem.collection==self.id).order_by(order_col)
+ return CollectionItem.query.filter_by(
+ collection=self.id).order_by(order_col)
def __repr__(self):
safe_title = self.title.encode('ascii', 'replace')