MCPcopy
hub / github.com/django/django / get

Method get

django/views/i18n.py:115–125  ·  view source on GitHub ↗
(self, request, *args, **kwargs)

Source from the content-addressed store, hash-verified

113 packages = None
114
115 def get(self, request, *args, **kwargs):
116 locale = get_language()
117 domain = kwargs.get("domain", self.domain)
118 # If packages are not provided, default to all installed packages, as
119 # DjangoTranslation without localedirs harvests them all.
120 packages = kwargs.get("packages", "")
121 packages = packages.split("+") if packages else self.packages
122 paths = self.get_paths(packages) if packages else None
123 self.translation = DjangoTranslation(locale, domain=domain, localedirs=paths)
124 context = self.get_context_data(**kwargs)
125 return self.render_to_response(context)
126
127 def get_paths(self, packages):
128 allowable_packages = {

Callers 5

set_languageFunction · 0.45
get_catalogMethod · 0.45
serveFunction · 0.45

Calls 6

get_pathsMethod · 0.95
get_context_dataMethod · 0.95
render_to_responseMethod · 0.95
get_languageFunction · 0.90
DjangoTranslationClass · 0.90
splitMethod · 0.45

Tested by

no test coverage detected