Ejemplo n.º 1
0
            'QUICKAPI_SWITCH_LANGUAGE': conf.QUICKAPI_SWITCH_LANGUAGE,
            'QUICKAPI_SWITCH_LANGUAGE_AUTO': conf.QUICKAPI_SWITCH_LANGUAGE_AUTO,
            'QUICKAPI_DECIMAL_LOCALE': conf.QUICKAPI_DECIMAL_LOCALE,
            'QUICKAPI_ENSURE_ASCII': conf.QUICKAPI_ENSURE_ASCII,
            'QUICKAPI_PYGMENTS_STYLE': conf.QUICKAPI_PYGMENTS_STYLE,
            'QUICKAPI_VERSIONS': conf.QUICKAPI_VERSIONS
        }
    return JSONResponse(data)

test.__doc__ = apidoc_lazy(
    header=_("""Test response."""),
    params=string_lazy(
"""
    1. "code" - %(co)s (%(nr)s);
    2. "redirect"  - %(re)s (%(nr)s).
""", {
    'co': _('code'),
    're': _('address for redirect'),
    'nr': _('not required'),
}),
    data=string_lazy(
"""
```
#!javascript

{
    "REMOTE_ADDR": "127.0.0.1" || null,
    "REMOTE_HOST": "example.org" || null,
    "default language": "en",
    "request language": "ru",
    "is_authenticated": true,
Ejemplo n.º 2
0
    Возвращает схему ReportAPI для пользователя.
    """
    data = site.get_scheme(request)
    return JSONResponse(data=data)

API_get_scheme.__doc__ = apidoc_lazy(
    header=_("*Returns the schema ReportAPI for the user.*"),
    data=string_lazy(
"""
```
#!javascript

{
    "icon": null,
    "label": "%s",
    "sections": {
        "icon": null,
        "label": "main",
        "reports_list": [],
        "reports": {}
    }
}
```
""", _('Reporting'))
)


@api_required
@login_required
def API_document_create(request, section, name, filters=None, force=False, fake=False, **kwargs):
    """