def show_catalogs():
    catalogs = Catalog.find_all()
    for catalog in catalogs:
        if len(catalog.name) > 20:
            catalog.name = catalog.name[:20] + '...'
        if len(catalog.description) > 32:
            catalog.description = catalog.description[:32] + '...'
    return render_template('catalog/catalog-list.html',
                           catalogs=catalogs,
                           session=login_session)
def get_catalogs():
    catalogs = Catalog.find_all()
    return jsonify({'catalogs':
                    [catalog.serializer for catalog in catalogs]}), 200