formfields

package
v0.0.0-...-7301b28 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: GPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRelationField

type BaseRelationField struct {
	*django_formfields.BaseField
	Field    attrs.FieldDefinition
	Relation attrs.Relation
}

type ForeignKeyFormField

type ForeignKeyFormField struct {
	BaseRelationField
}

func (*ForeignKeyFormField) HasChanged

func (f *ForeignKeyFormField) HasChanged(initial, data interface{}) bool

func (*ForeignKeyFormField) ValueToForm

func (f *ForeignKeyFormField) ValueToForm(value interface{}) interface{}

func (*ForeignKeyFormField) ValueToGo

func (f *ForeignKeyFormField) ValueToGo(value interface{}) (interface{}, error)

func (*ForeignKeyFormField) Widget

func (f *ForeignKeyFormField) Widget() widgets.Widget

type ManyToManyFormField

type ManyToManyFormField struct {
	BaseRelationField
}

func (*ManyToManyFormField) SaveField

func (o *ManyToManyFormField) SaveField(ctx context.Context, field attrs.Field, value interface{}) error

func (*ManyToManyFormField) Widget

func (o *ManyToManyFormField) Widget() widgets.Widget

type ModelSelect

type ModelSelect struct {
	*chooser.BaseChooser
	ExcludeBlank bool
	BlankLabel   string
}

func ModelSelectWidget

func ModelSelectWidget(allowBlank bool, blankLabel string, opts chooser.BaseChooserOptions, attrs map[string]string) *ModelSelect

func (*ModelSelect) GetContextData

func (o *ModelSelect) GetContextData(ctx context.Context, id, name string, value interface{}, widgetAttrs map[string]string) ctx.Context

func (*ModelSelect) Render

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

func (*ModelSelect) Validate

func (b *ModelSelect) Validate(ctx context.Context, value interface{}) []error

func (*ModelSelect) ValueToForm

func (f *ModelSelect) ValueToForm(value interface{}) interface{}

func (*ModelSelect) ValueToGo

func (f *ModelSelect) ValueToGo(value interface{}) (interface{}, error)

type MultiSelectWidget

type MultiSelectWidget[T attrs.Definer] struct {
	*widgets.BaseWidget
	Queryset     func() *queries.QuerySet[T]
	Relation     attrs.Relation
	FieldDef     attrs.FieldDefinition
	IncludeBlank bool
	BlankLabel   string
}

func (*MultiSelectWidget[T]) Choices

func (o *MultiSelectWidget[T]) Choices(ctx context.Context) []widgets.Option

func (*MultiSelectWidget[T]) GetContextData

func (o *MultiSelectWidget[T]) GetContextData(ctx context.Context, id, name string, value interface{}, attrs map[string]string) ctx.Context

func (*MultiSelectWidget[T]) Media

func (m *MultiSelectWidget[T]) Media() media.Media

func (*MultiSelectWidget[T]) Validate

func (o *MultiSelectWidget[T]) Validate(ctx context.Context, value interface{}) []error

func (*MultiSelectWidget[T]) ValueFromDataDict

func (m *MultiSelectWidget[T]) ValueFromDataDict(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) (interface{}, []error)

func (*MultiSelectWidget[T]) ValueOmittedFromData

func (m *MultiSelectWidget[T]) ValueOmittedFromData(ctx context.Context, data url.Values, files map[string][]filesystem.FileHeader, name string) bool

func (*MultiSelectWidget[T]) ValueToGo

func (o *MultiSelectWidget[T]) ValueToGo(value interface{}) (interface{}, error)

type OneToOneFormField

type OneToOneFormField struct {
	BaseRelationField
}

Jump to

Keyboard shortcuts

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