MCPcopy
hub / github.com/django/django / __str__

Method __str__

django/contrib/admin/models.py:96–107  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 return str(self.action_time)
95
96 def __str__(self):
97 if self.is_addition():
98 return gettext("Added “%(object)s”.") % {"object": self.object_repr}
99 elif self.is_change():
100 return gettext("Changed “%(object)s” — %(changes)s") % {
101 "object": self.object_repr,
102 "changes": self.get_change_message(),
103 }
104 elif self.is_deletion():
105 return gettext("Deleted “%(object)s.”") % {"object": self.object_repr}
106
107 return gettext("LogEntry Object")
108
109 def is_addition(self):
110 return self.action_flag == ADDITION

Callers

nothing calls this directly

Calls 5

is_additionMethod · 0.95
is_changeMethod · 0.95
get_change_messageMethod · 0.95
is_deletionMethod · 0.95
gettextFunction · 0.90

Tested by

no test coverage detected