Пример #1
0
Файл: lib.py Проект: tbalaz/test
def pager_url(ignore=None, page=None):
    # This has params the same as ckan.controllers.Package.pager_url NOT
    # ckan.helpers.pager_url
    routes_dict = _pylons_default_url.environ['pylons.routes_dict']
    kwargs = {}
    kwargs['controller'] = routes_dict['controller']
    kwargs['action'] = routes_dict['action']
    if routes_dict.get('id'):
        kwargs['id'] = routes_dict['id']
    kwargs['page'] = page
    return _pylons_default_url(**kwargs)
Пример #2
0
def pager_url(ignore=None, page=None):
    # This has params the same as ckan.controllers.Package.pager_url NOT
    # ckan.helpers.pager_url
    routes_dict = _pylons_default_url.environ['pylons.routes_dict']
    kwargs = {}
    kwargs['controller'] = routes_dict['controller']
    kwargs['action'] = routes_dict['action']
    if routes_dict.get('id'):
        kwargs['id'] = routes_dict['id']
    kwargs['page'] = page
    return _pylons_default_url(**kwargs)
Пример #3
0
def url(*args, **kw):
    """Create url adding i18n information if selected
    wrapper for pylons.url"""
    locale = kw.pop('locale', None)
    my_url = _pylons_default_url(*args, **kw)
    return _add_i18n_to_url(my_url, locale=locale, **kw)
Пример #4
0
def url(*args, **kw):
    """Create url adding i18n information if selected
    wrapper for pylons.url"""
    locale = kw.pop('locale', None)
    my_url = _pylons_default_url(*args, **kw)
    return _add_i18n_to_url(my_url, locale=locale, **kw)