コード例 #1
0
def jsonItems(**kwargs):
    """
    Serve JSON with all or filtered items.
    """
    if not isAdmin() and not 'user_id' in kwargs:
        return showItems(json=True, user_id=session['user_id'], **kwargs)
    return showItems(json=True, **kwargs)
コード例 #2
0
def showUserItem(user_id, item_id=None, **kwargs):
    """
    Show user's items.
    """
    if item_id:
        return showItem(user_id=user_id, item_id=item_id, **kwargs)
    return showItems(user_id=user_id, **kwargs)
コード例 #3
0
def showUserCategory(user_id, category_id=None, **kwargs):
    """
    Show the user categories.
    """
    if category_id == 1:
        return showItems(user_id=user_id, category_id=category_id, **kwargs)

    if category_id:
        return showCategory(user_id=user_id, category_id=category_id, **kwargs)
    return showCategories(user_id=user_id, **kwargs)
コード例 #4
0
def showUserCollection(user_id, collection_id=None, **kwargs):
    """
    Show the user collections.
    """
    if collection_id == 1:
        return showItems(user_id=user_id,
                         collection_id=collection_id,
                         **kwargs)

    if collection_id:
        return showCollection(user_id=user_id,
                              collection_id=collection_id,
                              **kwargs)

    return showCollections(user_id=user_id, **kwargs)
コード例 #5
0
def showTag(tag, **kwargs):
    """
    Show all the items for the selected tag.
    """
    return showItems(tag=tag, **kwargs)
コード例 #6
0
def showTags(**kwargs):
    """
    Show all the tags.
    """
    return showItems()