Returns `True` if the label based on the model's verbose name is not equal to the default label it would have based on it's field name.
(model_field, field_name)
| 44 | |
| 45 | |
| 46 | def needs_label(model_field, field_name): |
| 47 | """ |
| 48 | Returns `True` if the label based on the model's verbose name |
| 49 | is not equal to the default label it would have based on it's field name. |
| 50 | """ |
| 51 | default_label = field_name.replace('_', ' ').capitalize() |
| 52 | return capfirst(model_field.verbose_name) != default_label |
| 53 | |
| 54 | |
| 55 | def get_detail_view_name(model): |
no outgoing calls
no test coverage detected