views.generic.list.MultipleObjectTemplateResponseMixin

class django.views.generic.list.MultipleObjectTemplateResponseMixin A mixin class that performs template-based response rendering for views that operate upon a list of object instances. Requires that the view it is mixed with provides self.object_list, the list of object instances that the view is operating on. self.object_list may be, but is not required to be, a QuerySet. Extends TemplateResponseMixin Methods and Attributes template_name_suffix The suffix to append to the auto-generat

views.generic.list.MultipleObjectTemplateResponseMixin.get_template_names()

get_template_names() Returns a list of candidate template names. Returns the following list: the value of template_name on the view (if provided) <app_label>/<model_name><template_name_suffix>.html

views.generic.list.MultipleObjectTemplateResponseMixin.template_name_suffix

template_name_suffix The suffix to append to the auto-generated candidate template name. Default suffix is _list.

views.i18n.JavaScriptCatalog

class JavaScriptCatalog [source] A view that produces a JavaScript code library with functions that mimic the gettext interface, plus an array of translation strings. Attributes domain Translation domain containing strings to add in the view output. Defaults to 'djangojs'. packages A list of application names among installed applications. Those apps should contain a locale directory. All those catalogs plus all catalogs found in LOCALE_PATHS (which are always included) are merged in

views.i18n.JavaScriptCatalog.domain

domain Translation domain containing strings to add in the view output. Defaults to 'djangojs'.

views.i18n.JavaScriptCatalog.packages

packages A list of application names among installed applications. Those apps should contain a locale directory. All those catalogs plus all catalogs found in LOCALE_PATHS (which are always included) are merged into one catalog. Defaults to None, which means that all available translations from all INSTALLED_APPS are provided in the JavaScript output. Example with default values: from django.views.i18n import JavaScriptCatalog urlpatterns = [ url(r'^jsi18n/$', JavaScriptCatalog.as_view(

views.i18n.javascript_catalog()

javascript_catalog(request, domain='djangojs', packages=None) [source] Deprecated since version 1.10: javascript_catalog() is deprecated in favor of JavaScriptCatalog and will be removed in Django 2.0. The main solution to these problems is the django.views.i18n.javascript_catalog() view, which sends out a JavaScript code library with functions that mimic the gettext interface, plus an array of translation strings. Those translation strings are taken from applications or Django core, accor

views.i18n.JSONCatalog

class JSONCatalog [source] In order to use another client-side library to handle translations, you may want to take advantage of the JSONCatalog view. It’s similar to JavaScriptCatalog but returns a JSON response. See the documentation for JavaScriptCatalog to learn about possible values and use of the domain and packages attributes. The response format is as follows: { "catalog": { # Translations catalog }, "formats": { # Language formats for date, time, etc.

views.i18n.json_catalog()

json_catalog(request, domain='djangojs', packages=None) [source] Deprecated since version 1.10: json_catalog() is deprecated in favor of JSONCatalog and will be removed in Django 2.0. In order to use another client-side library to handle translations, you may want to take advantage of the json_catalog() view. It’s similar to javascript_catalog() but returns a JSON response. The JSON object contains i18n formatting settings (those available for get_format), a plural rule (as a plural part o

views.i18n.set_language()

set_language(request) [source] As a convenience, Django comes with a view, django.views.i18n.set_language(), that sets a user’s language preference and redirects to a given URL or, by default, back to the previous page. Activate this view by adding the following line to your URLconf: url(r'^i18n/', include('django.conf.urls.i18n')), (Note that this example makes the view available at /i18n/setlang/.) Warning Make sure that you don’t include the above URL within i18n_patterns() - it needs t