def list_collections(request): """list all collections in repository returns list of :class:`~genrepo.collection.models.CollectionObject` """ colls = CollectionObject.all() colls = list(accessible(colls)) colls.sort(key=lambda coll: coll.label.upper()) # sort based on label return render(request, "collection/list.html", {"colls": colls})
def list_collections(request): '''list all collections in repository returns list of :class:`~genrepo.collection.models.CollectionObject` ''' colls = CollectionObject.all() colls = list(accessible(colls)) colls.sort(key=lambda coll: coll.label.upper()) # sort based on label return render(request, 'collection/list.html', {'colls': colls})
def _collection_options(): collections = list(accessible(CollectionObject.all())) options = [('', '')] + \ [ ('info:fedora/' + c.pid, c.label or c.pid) for c in collections ] return options