1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Simplify help_text for ExpandableNameField

This commit is contained in:
Jeremy Stretch
2020-02-06 11:44:29 -05:00
parent a2475ee501
commit 85729f3df8

View File

@ -451,12 +451,14 @@ class ExpandableNameField(forms.CharField):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
if not self.help_text: if not self.help_text:
self.help_text = 'Alphanumeric ranges are supported for bulk creation.<br />' \ self.help_text = """
'Mixed cases and types within a single range are not supported.<br />' \ Alphanumeric ranges are supported for bulk creation. Mixed cases and types within a single range
'Examples:<ul><li><code>ge-0/0/[0-23,25,30]</code></li>' \ are not supported. Examples:
'<li><code>e[0-3][a-d,f]</code></li>' \ <ul>
'<li><code>[xe,ge]-0/0/0</code></li>' \ <li><code>[ge,xe]-0/0/[0-9]</code></li>
'<li><code>e[0-3,a-d,f]</code></li></ul>' <li><code>e[0-3][a-d,f]</code></li>
</ul>
"""
def to_python(self, value): def to_python(self, value):
if re.search(ALPHANUMERIC_EXPANSION_PATTERN, value): if re.search(ALPHANUMERIC_EXPANSION_PATTERN, value):