Create interface - Max length of description #4809

Closed
opened 2025-12-29 19:20:50 +01:00 by adam · 2 comments
Owner

Originally created by @akashha on GitHub (Apr 22, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11

Python version

3.9

Steps to Reproduce

1 - Add interface on device ( /dcim/interfaces/add/?device=24 ), max lenght of description is 100 characters
2 - Edit the interface, max lenght is 200 (/dcim/interfaces/24/edit/)

Expected Behavior

Can you set the max directly to 200 in create interface description ?

Observed Behavior

Hello,

When create :
<input type="text" name="description" maxlength="100" class="form-control" placeholder="None" id="id_description">

When edit :
<input type="text" name="description" maxlength="200" class="form-control" placeholder="None" id="id_description">

Cordialy.

Originally created by @akashha on GitHub (Apr 22, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11 ### Python version 3.9 ### Steps to Reproduce 1 - Add interface on device ( /dcim/interfaces/add/?device=24 ), max lenght of description is 100 characters 2 - Edit the interface, max lenght is 200 (/dcim/interfaces/24/edit/) ### Expected Behavior Can you set the max directly to 200 in create interface description ? ### Observed Behavior Hello, When create : `<input type="text" name="description" maxlength="100" class="form-control" placeholder="None" id="id_description">` When edit : `<input type="text" name="description" maxlength="200" class="form-control" placeholder="None" id="id_description">` Cordialy.
adam added the type: bugstatus: accepted labels 2025-12-29 19:20:50 +01:00
adam closed this issue 2025-12-29 19:20:50 +01:00
Author
Owner

@candlerb commented on GitHub (Apr 22, 2021):

class ComponentModel has:

    name = models.CharField(
        max_length=64
    )
...
    label = models.CharField(
        max_length=64,
        blank=True,
        help_text="Physical label"
    )
    description = models.CharField(
        max_length=200,
        blank=True
    )

A similar issue exists for name and label. When creating an interface, there is no maxlength for these fields in the HTML:

<input type="text" name="name_pattern" class="form-control" required="" placeholder="Name" id="id_name_pattern">
...
<input type="text" name="label_pattern" class="form-control" placeholder="Label" id="id_label_pattern">

But when editing an interface, it gives maxlength=64 as expected

<input type="text" name="name" value="br255" maxlength="64" class="form-control" required="" placeholder="Name" id="id_name">
...
<input type="text" name="label" maxlength="64" class="form-control" placeholder="Label" id="id_label">
@candlerb commented on GitHub (Apr 22, 2021): class ComponentModel has: ``` name = models.CharField( max_length=64 ) ... label = models.CharField( max_length=64, blank=True, help_text="Physical label" ) description = models.CharField( max_length=200, blank=True ) ``` A similar issue exists for name and label. When creating an interface, there is no maxlength for these fields in the HTML: ``` <input type="text" name="name_pattern" class="form-control" required="" placeholder="Name" id="id_name_pattern"> ... <input type="text" name="label_pattern" class="form-control" placeholder="Label" id="id_label_pattern"> ``` But when editing an interface, it gives maxlength=64 as expected ``` <input type="text" name="name" value="br255" maxlength="64" class="form-control" required="" placeholder="Name" id="id_name"> ... <input type="text" name="label" maxlength="64" class="form-control" placeholder="Label" id="id_label"> ```
Author
Owner

@jeremystretch commented on GitHub (Apr 22, 2021):

The name and label fields don't get a maximum length because they allow specifying a pattern (which may be longer than the resulting values).

@jeremystretch commented on GitHub (Apr 22, 2021): The `name` and `label` fields don't get a maximum length because they allow specifying a pattern (which may be longer than the resulting values).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4809