MCPcopy
hub / github.com/django/django / _format_names

Method _format_names

django/db/models/options.py:251–259  ·  view source on GitHub ↗

App label/class name interpolation for object names.

(self, objs)

Source from the content-addressed store, hash-verified

249 setting_changed.connect(self.setting_changed)
250
251 def _format_names(self, objs):
252 """App label/class name interpolation for object names."""
253 names = {"app_label": self.app_label.lower(), "class": self.model_name}
254 new_objs = []
255 for obj in objs:
256 obj = obj.clone()
257 obj.name %= names
258 new_objs.append(obj)
259 return new_objs
260
261 def _get_default_pk_class(self):
262 pk_class_path = getattr(

Callers 1

contribute_to_classMethod · 0.95

Calls 2

cloneMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected