コード例 #1
0
def showCategoriesJSON():
    """
	Get the categories in JSON format.
	
	URLs:
		'/catalog/category/JSON/'
	
	Args:
		None
	"""

    categories = readCategories()
    return jsonify(categories=[c.serialize for c in categories])
コード例 #2
0
def showAllCategories():
    """
	Show all categories.
	
	URLs:
		'/catalog/category/all/'
	
	Args:
		None
	"""

    categories = readCategories()
    return render_template('show_all_categories.html', categories=categories)
コード例 #3
0
def showCategoriesJSON():
	"""
	Get the categories in JSON format.
	
	URLs:
		'/catalog/category/JSON/'
	
	Args:
		None
	"""

	categories = readCategories()
	return jsonify(categories=[c.serialize for c in categories])
コード例 #4
0
def showAllCategories():
	"""
	Show all categories.
	
	URLs:
		'/catalog/category/all/'
	
	Args:
		None
	"""

	categories = readCategories()
	return render_template('show_all_categories.html', categories=categories)
コード例 #5
0
def showCategories():
	"""
	Show all categories.
	
	URLs:
		'/'
		'/catalog/'

	Args:
		None
	"""
	
	categories = readCategories()
	latestItems = readLatestItems(10)
	if 'username' not in login_session:
		return render_template('public_catalog.html', categories=categories,
			latestItems=latestItems)
	else:
		return render_template('catalog.html', categories=categories,
			latestItems=latestItems)
コード例 #6
0
def showCategories():
    """
	Show all categories.
	
	URLs:
		'/'
		'/catalog/'

	Args:
		None
	"""

    categories = readCategories()
    latestItems = readLatestItems(10)
    if 'username' not in login_session:
        return render_template('public_catalog.html',
                               categories=categories,
                               latestItems=latestItems)
    else:
        return render_template('catalog.html',
                               categories=categories,
                               latestItems=latestItems)