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 os
|
||||
import pkgutil
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
import yaml
|
||||
@ -24,6 +23,7 @@ from .forms import ScriptForm
|
||||
__all__ = [
|
||||
'Script',
|
||||
'StringVar',
|
||||
'TextVar',
|
||||
'IntegerVar',
|
||||
'BooleanVar',
|
||||
'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):
|
||||
"""
|
||||
Integer representation. Can enforce minimum/maximum values.
|
||||
|
Reference in New Issue
Block a user