tailbone.forms.widgets

Form Widgets

class tailbone.forms.widgets.CasesUnitsWidget(**kw)[source]

Widget for collecting case and/or unit quantities. Most useful when you need to ensure user provides cases or units but not both.

class tailbone.forms.widgets.CustomSelectWidget(**kw)[source]

This widget is mostly for convenience. You can set extra kwargs for the serialize() method, e.g.:

widget.set_template_values(foo='bar')
class tailbone.forms.widgets.CustomerAutocompleteWidget(request, *args, **kwargs)[source]

Autocomplete widget for a Customer reference field.

class tailbone.forms.widgets.CustomerDropdownWidget(request, *args, **kwargs)[source]

Dropdown widget for a Customer reference field.

class tailbone.forms.widgets.DepartmentWidget(request, **kwargs)[source]

Custom select widget for a Department reference field.

Constructor accepts the normal values kwarg but if not provided then the widget will fetch department list from Rattail DB.

Constructor also accepts required kwarg, which defaults to true unless specified.

class tailbone.forms.widgets.DynamicCheckboxWidget(**kw)[source]

This checkbox widget can be “dynamic” in the sense that form logic can control its value and state.

class tailbone.forms.widgets.DynamicSelectWidget(**kw)[source]

This is a “normal” select widget, but instead of (or in addition to) its values being set when constructed, they must be assigned dynamically in real-time, e.g. based on other user selections.

Really all this widget “does” is render some Vue.js-compatible HTML, but the page which contains the widget is ultimately responsible for wiring up the logic for things to work right.

class tailbone.forms.widgets.FalafelDateTimeWidget(**kw)[source]

Custom widget for rattail UTC datetimes

class tailbone.forms.widgets.FalafelTimeWidget(*args, **kwargs)[source]

Custom widget for simple time fields

class tailbone.forms.widgets.JQueryAutocompleteWidget(**kw)[source]

Uses the jQuery autocomplete plugin, instead of whatever it is deform uses by default.

requirements = None
class tailbone.forms.widgets.JQueryDateWidget(**kw)[source]

Uses the jQuery datepicker UI widget, instead of whatever it is deform uses by default.

requirements = None
class tailbone.forms.widgets.JQuerySelectWidget(**kw)[source]
class tailbone.forms.widgets.JQueryTimeWidget(*args, **kwargs)[source]

Uses the jQuery datepicker UI widget, instead of whatever it is deform uses by default.

requirements = None
class tailbone.forms.widgets.MultiFileUploadWidget(tmpstore, **kw)[source]

Widget to handle multiple (arbitrary number) of file uploads.

class tailbone.forms.widgets.NumberInputWidget(**kw)[source]
class tailbone.forms.widgets.NumericInputWidget(**kw)[source]

This widget uses a <numeric-input> component, which will leverage the numeric.js functions to ensure user doesn’t enter any non-numeric values. Note that this still uses a normal “text” input on the HTML side, as opposed to a “number” input, since the latter is a bit ugly IMHO.

class tailbone.forms.widgets.PercentInputWidget(**kw)[source]

Custom text input widget, used for “percent” type fields. This widget assumes that the underlying storage for the value is a “traditional” percent value, e.g. 0.36135 - but the UI should represent this as a “human-friendly” value, e.g. 36.135 %.

class tailbone.forms.widgets.PlainDateWidget(**kw)[source]
class tailbone.forms.widgets.PlainSelectWidget(**kw)[source]
class tailbone.forms.widgets.ReadonlyWidget(**kw)[source]
class tailbone.forms.widgets.VendorAutocompleteWidget(request, *args, **kwargs)[source]

Autocomplete widget for a Vendor reference field.

class tailbone.forms.widgets.VendorDropdownWidget(request, *args, **kwargs)[source]

Dropdown widget for a Vendor reference field.

tailbone.forms.widgets.make_customer_widget(request, **kwargs)[source]

Make a customer widget; will be either autocomplete or dropdown depending on config.

tailbone.forms.widgets.make_vendor_widget(request, **kwargs)[source]

Make a vendor widget; will be either autocomplete or dropdown depending on config.