fieldtype

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type string

A Type defines a type of a model's field

const (
	NoType    Type = ""
	Binary    Type = "binary"
	Boolean   Type = "boolean"
	Char      Type = "char"
	Date      Type = "date"
	DateTime  Type = "datetime"
	Float     Type = "float"
	HTML      Type = "html"
	Integer   Type = "integer"
	Many2Many Type = "many2many"
	Many2One  Type = "many2one"
	One2Many  Type = "one2many"
	One2One   Type = "one2one"
	Rev2One   Type = "rev2one"
	Reference Type = "reference"
	Selection Type = "selection"
	Text      Type = "text"
)

Types for model fields

func (Type) DefaultGoType

func (t Type) DefaultGoType() reflect.Type

DefaultGoType returns this Type's default Go type

func (Type) Is2ManyRelationType

func (t Type) Is2ManyRelationType() bool

Is2ManyRelationType returns true for relation types that point to multiple comodel records (i.e. M2M and O2M)

func (Type) Is2OneRelationType

func (t Type) Is2OneRelationType() bool

Is2OneRelationType returns true for relation types that point to a single comodel record (i.e. M2O, O2O and R2O)

func (Type) IsFKRelationType

func (t Type) IsFKRelationType() bool

IsFKRelationType returns true for relation types that are stored in the model's table (i.e. M2O and O2O)

func (Type) IsNonStoredRelationType

func (t Type) IsNonStoredRelationType() bool

IsNonStoredRelationType returns true for relation types that are not stored in the model's table (i.e. M2M, O2M and R2O)

func (Type) IsNullInDB added in v0.0.12

func (t Type) IsNullInDB() bool

IsNullInDB returns true if this type's zero value is saved as null in database.

func (Type) IsRelationType

func (t Type) IsRelationType() bool

IsRelationType returns true if this type is a relation.

func (Type) IsReverseRelationType

func (t Type) IsReverseRelationType() bool

IsReverseRelationType returns true for relation types that are stored in the comodel's table (i.e. O2M and R2O)

Jump to

Keyboard shortcuts

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