chooser

package
v1.6.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 (o *Select) GetContextData(id, name string, value interface{}, widgetAttrs map[string]string) ctx.Context

func (*Select) Render

func (b *Select) Render(w io.Writer, id, name string, value interface{}, attrs map[string]string) error

func (*Select) RenderWithErrors

func (b *Select) RenderWithErrors(w io.Writer, id, name string, value interface{}, errors []error, attrs map[string]string) error

func (*Select) ValueToForm

func (o *Select) ValueToForm(value interface{}) interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL