MCPcopy
hub / github.com/django/django / css_classes

Method css_classes

django/forms/boundfield.py:225–236  ·  view source on GitHub ↗

Return a string of space-separated CSS classes for this field.

(self, extra_classes=None)

Source from the content-addressed store, hash-verified

223 return self.label_tag(contents, attrs, label_suffix, tag="legend")
224
225 def css_classes(self, extra_classes=None):
226 """
227 Return a string of space-separated CSS classes for this field.
228 """
229 if hasattr(extra_classes, "split"):
230 extra_classes = extra_classes.split()
231 extra_classes = set(extra_classes or [])
232 if self.errors and hasattr(self.form, "error_css_class"):
233 extra_classes.add(self.form.error_css_class)
234 if self.field.required and hasattr(self.form, "required_css_class"):
235 extra_classes.add(self.form.required_css_class)
236 return " ".join(extra_classes)
237
238 @property
239 def is_hidden(self):

Callers

nothing calls this directly

Calls 3

splitMethod · 0.45
addMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected