mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add TextVar for large text entry
This commit is contained in:
@ -3,7 +3,6 @@ import inspect
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import pkgutil
|
import pkgutil
|
||||||
import sys
|
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import yaml
|
import yaml
|
||||||
@ -24,6 +23,7 @@ from .forms import ScriptForm
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
'Script',
|
'Script',
|
||||||
'StringVar',
|
'StringVar',
|
||||||
|
'TextVar',
|
||||||
'IntegerVar',
|
'IntegerVar',
|
||||||
'BooleanVar',
|
'BooleanVar',
|
||||||
'ObjectVar',
|
'ObjectVar',
|
||||||
@ -87,6 +87,18 @@ class StringVar(ScriptVariable):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class TextVar(ScriptVariable):
|
||||||
|
"""
|
||||||
|
Free-form text data. Renders as a <textarea>.
|
||||||
|
"""
|
||||||
|
form_field = forms.CharField
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
self.field_attrs['widget'] = forms.Textarea
|
||||||
|
|
||||||
|
|
||||||
class IntegerVar(ScriptVariable):
|
class IntegerVar(ScriptVariable):
|
||||||
"""
|
"""
|
||||||
Integer representation. Can enforce minimum/maximum values.
|
Integer representation. Can enforce minimum/maximum values.
|
||||||
|
Reference in New Issue
Block a user