def get_value(self, context, page_lookup, lang, site): site_id = get_site_id(site) request = context.get('request', False) if not request: return '' if lang is None: lang = get_language_from_request(request) url = get_page_url_cache(page_lookup, lang, site_id) if url is None: page = _get_page_by_untyped_arg(page_lookup, request, site_id) if page: url = page.get_absolute_url(language=lang) set_page_url_cache(page_lookup, lang, site_id, url) if url: return url return ''
def get_value(self, context, page_lookup, lang, site): site_id = get_site_id(site) request = context.get('request', False) if not request: return '' if lang is None: lang = get_language_from_request(request) url = get_page_url_cache(page_lookup, lang, site_id) if url is None: page = _get_page_by_untyped_arg(page_lookup, request, site_id) if page: url = page.get_absolute_url(language=lang) set_page_url_cache(page_lookup, lang, site_id, url) if url: return url return ''