Skip to content

Extend BooleanColumn to allow rendering a placeholder for false values #16933

@jeremystretch

Description

@jeremystretch

NetBox version

v4.0.7

Feature type

New functionality

Proposed functionality

Currently, NetBox's custom BooleanColumn will render a checkmark for true values, an X for false values, and a placeholder for null values.

This FR proposes new keyword arguments which enable overriding the default HTML content for true and false values. Setting either of these to None will render an empty placeholder, as with null values.

foo = columns.BooleanColumn(
    true_content='Yup',
    false_content=None
)

Use case

Sometimes a negative condition is not inherently problematic, and is not appropriate to flag as "wrong" using a red X. For example, consider the "management only" field on the interface model. We care to indicate when an interface has been so designated, but otherwise this attribute needs no further attention. (Contrast this to the "enabled" field, wherein a false value is likely more worthy of consideration.)

Database changes

None

External dependencies

None

Metadata

Metadata

Assignees

Labels

complexity: lowRequires minimal effort to implementstatus: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions