def section(request, menu_id, *path): '''This view receives a tokenized path within a menu, and calls the menu renderer. Used by the basic menu template, but may be deprecated in the future for a more flexible view that doens't require the path to be tokenized.''' logger.debug('mid: %s, path: %s', menu_id, path) menu = dao.get_menu(menu_id) logger.info('menu: %s, path: %s', menu, path) return render_menu(request, menu, '/'.join(path))
def menu(request, menu_id, path = ''): '''Main entry point for a menu. It takes the menu ID and the path within that menu the user is requesting. It uses the menu renderer configured in orders/settings.py''' logger.debug('menu_id: %s, path: %s', menu_id, path) client_id = request.session['client_id'] m = dao.get_menu(menu_id) logger.info('with menu_id %s found: %s', menu_id, m) return render_menu(request, m, path)