MCPcopy
hub / github.com/django/django / _get

Method _get

django/contrib/sitemaps/__init__.py:29–40  ·  view source on GitHub ↗
(self, name, item, default=None)

Source from the content-addressed store, hash-verified

27 x_default = False
28
29 def _get(self, name, item, default=None):
30 try:
31 attr = getattr(self, name)
32 except AttributeError:
33 return default
34 if callable(attr):
35 if self.i18n:
36 # Split the (item, lang_code) tuples again for the location,
37 # priority, lastmod and changefreq method calls.
38 item, lang_code = item
39 return attr(item)
40 return attr
41
42 def get_languages_for_item(self, item):
43 """Languages for which this item is displayed."""

Callers 2

_locationMethod · 0.95
_urlsMethod · 0.95

Calls 1

callableFunction · 0.85

Tested by

no test coverage detected