MCPcopy Create free account
hub / github.com/django/django / format_value

Method format_value

django/forms/widgets.py:579–584  ·  view source on GitHub ↗

Return the file object if it has a defined url attribute.

(self, value)

Source from the content-addressed store, hash-verified

577 return bool(value and getattr(value, "url", False))
578
579 def format_value(self, value):
580 """
581 Return the file object if it has a defined url attribute.
582 """
583 if self.is_initial(value):
584 return value
585
586 def get_context(self, name, value, attrs):
587 context = super().get_context(name, value, attrs)

Callers

nothing calls this directly

Calls 1

is_initialMethod · 0.95

Tested by

no test coverage detected