import json from django import forms from django.conf import settings from django.contrib.postgres.forms import SimpleArrayField from utilities.choices import ColorChoices from .utils import add_blank_choice, parse_numeric_range __all__ = ( 'APISelect', 'APISelectMultiple', 'BulkEditNullBooleanSelect', 'ColorSelect', 'ContentTypeSelect', 'DatePicker', 'DateTimePicker', 'NumericArrayField', 'SelectSpeedWidget', 'SelectWithDisabled', 'SelectWithPK', 'SlugWidget', 'SmallTextarea', 'StaticSelect', 'StaticSelectMultiple', 'TimePicker', ) class SmallTextarea(forms.Textarea): """ Subclass used for rendering a smaller textarea element. """ pass class SlugWidget(forms.TextInput): """ Subclass TextInput and add a slug regeneration button next to the form field. """ template_name = 'widgets/sluginput.html' class ColorSelect(forms.Select): """ Extends the built-in Select widget to colorize each