예제 #1
0
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})
예제 #2
0
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})
예제 #3
0
 def test_all(self):
     with patch('genrepo.collection.models.Repository') as mockrepo:
         CollectionObject.all()
         mockrepo().get_objects_with_cmodel.assert_called_with(
             CollectionObject.COLLECTION_CONTENT_MODEL,
             type=CollectionObject)
예제 #4
0
def _collection_options():
    collections = list(accessible(CollectionObject.all()))
    options = [('', '')] + \
        [ ('info:fedora/' + c.pid, c.label or c.pid)
          for c in collections ]
    return options
예제 #5
0
def _collection_options():
    collections = list(accessible(CollectionObject.all()))
    options = [('', '')] + \
        [ ('info:fedora/' + c.pid, c.label or c.pid)
          for c in collections ]
    return options