Documentation
¶
Index ¶
- type BaseChooser
- type BaseChooserOptions
- type Select
- func (o *Select) GetContextData(id, name string, value interface{}, widgetAttrs map[string]string) ctx.Context
- func (b *Select) Render(w io.Writer, id, name string, value interface{}, attrs map[string]string) error
- func (b *Select) RenderWithErrors(w io.Writer, id, name string, value interface{}, errors []error, ...) error
- func (o *Select) ValueToForm(value interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseChooser ¶
type BaseChooser struct {
widgets.BaseWidget
Opts BaseChooserOptions
// contains filtered or unexported fields
}
func BaseChooserWidget ¶
func BaseChooserWidget(opts BaseChooserOptions) *BaseChooser
func (*BaseChooser) QuerySet ¶
func (o *BaseChooser) QuerySet() ([]interface{}, error)
func (*BaseChooser) Validate ¶
func (o *BaseChooser) Validate(value interface{}) []error
type BaseChooserOptions ¶
type BaseChooserOptions struct {
TargetObject interface{}
GetPrimaryKey func(interface{}) interface{}
Queryset func() ([]interface{}, error)
}
type Select ¶
type Select struct {
*BaseChooser
ExcludeBlank bool
BlankLabel string
}
func SelectWidget ¶
func SelectWidget(allowBlank bool, blankLabel string, opts BaseChooserOptions) *Select
func (*Select) GetContextData ¶
func (*Select) RenderWithErrors ¶
func (*Select) ValueToForm ¶
func (o *Select) ValueToForm(value interface{}) interface{}
Click to show internal directories.
Click to hide internal directories.