diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index 2b92598..f2ecf9e 100644
|
a
|
b
|
class Collection(Base, CollectionMixin):
|
| 429 | 429 | UniqueConstraint('creator', 'slug'), |
| 430 | 430 | {}) |
| 431 | 431 | |
| 432 | | def get_collection_items(self, ascending=False): |
| | 432 | def get_collection_items(self, order_col=None, ascending=False): |
| 433 | 433 | #TODO, is this still needed with self.collection_items being available? |
| 434 | | order_col = CollectionItem.position |
| | 434 | if order_col is None: |
| | 435 | order_col = CollectionItem.position |
| 435 | 436 | if not ascending: |
| 436 | 437 | order_col = desc(order_col) |
| 437 | | return CollectionItem.query.filter_by( |
| 438 | | collection=self.id).order_by(order_col) |
| | 438 | return CollectionItem.query.join(MediaEntry).filter( |
| | 439 | CollectionItem.collection==self.id).order_by(order_col) |
| 439 | 440 | |
| 440 | 441 | |
| 441 | 442 | class CollectionItem(Base, CollectionItemMixin): |
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 738cc05..ad74082 100644
|
a
|
b
|
def user_collection(request, page, url_user=None):
|
| 314 | 314 | if not collection: |
| 315 | 315 | return render_404(request) |
| 316 | 316 | |
| 317 | | cursor = collection.get_collection_items() |
| | 317 | cursor = collection.get_collection_items(order_col=MediaEntry.created) |
| 318 | 318 | |
| 319 | 319 | pagination = Pagination(page, cursor) |
| 320 | 320 | collection_items = pagination() |