people

package module
v0.0.0-...-9e8cf05 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 24 Imported by: 0

README

people

People resources for Ecletus Framework

Documentation

Index

Constants

View Source
const (
	SCHEME_INDIVIDUAL = "Individual"
	SCHEME_BUSINESS   = "Business"
	ResourceID        = "People"
)
View Source
const (
	ICON_BUSINESS = "/images/icon-manufacturer.png"
	ICON_MEN      = "/images/icon-men.png"
	ICON_WOMAN    = "/images/icon-woman.png"
)

Variables

View Source
var (
	PKG        = path_helpers.GetCalledDir()
	I18N_GROUP = i18nmod.PkgToGroup(PKG)
)
View Source
var DEFAULT_SCHEMES_CATEGORIES = []string{admin_tabs.SCHEME_CATEGORY}
View Source
var ImageTag, _ = template.New("qor:db:common.people.tag.image").Parse("<img src=\"{{.}}\"></img>")

Functions

func GetResource

func GetResource(Admin *admin.Admin) *admin.Resource

func InitResource

func InitResource(Admin *admin.Admin) *admin.Resource

func PrepareResource

func PrepareResource(res *admin.Resource)

Types

type Address

type Address struct {
	address.Address
	PeopleID bid.BID
}

func (*Address) GetAddress

func (pa *Address) GetAddress() *address.Address

type Config

type Config struct {
	FieldName string
	Tabs      []*admin_tabs.Tab
}

type Mail

type Mail struct {
	mail.Mail
	PeopleID bid.BID
}

type Media

type Media struct {
	aorm.Model
	PeopleID     bid.BID
	Title        string
	SelectedType string
	File         media_library.MediaLibraryStorage
}

func (*Media) GetMediaOption

func (i *Media) GetMediaOption(ctx *core.Context) (mediaOption media_library.MediaOption)

func (*Media) GetSelectedType

func (i *Media) GetSelectedType() string

func (*Media) Init

func (i *Media) Init(site *core.Site)

func (*Media) ScanMediaOptions

func (i *Media) ScanMediaOptions(mediaOption media_library.MediaOption) error

func (*Media) SetSelectedType

func (i *Media) SetSelectedType(typ string)

func (*Media) Validate

func (i *Media) Validate(db *aorm.DB)

type People

type People struct {
	aorm.AuditedSDModel
	fragment.FragmentedModel
	FullName      string `sql:"size:255"`
	NickName      string `sql:"size:255"`
	Business      bool   `sql:"not null"`
	Doc           string `sql:"size:255;unique_index:={} IS NOT NULL AND {} <> ''"`
	Male          *bool
	Birthday      *time.Time `sql:"type:date"`
	Avatar        oss.Image
	PhoneID       bid.BID
	Phone         *phone.Phone
	MobileID      bid.BID
	Mobile        *phone.Phone
	OtherPhones   []Phone `aorm:"fkc"`
	MailID        bid.BID
	Mail          *mail.Mail
	OtherMails    []Mail `aorm:"fkc"`
	MainAddressID bid.BID
	MainAddress   address.Address
	OtherAdresses []Address `aorm:"fkc"`
	Media         []Media   `sql:"foreignkey:PeopleID;fkc"`
	Notes         string    `sql:"type:text"`
}

func (*People) Clean

func (m *People) Clean(db *aorm.DB)

func (People) GetAormInlinePreloadFields

func (People) GetAormInlinePreloadFields() []string

func (*People) IsBusiness

func (p *People) IsBusiness() bool

func (*People) String

func (p *People) String() string

func (*People) Stringify

func (p *People) Stringify() string

func (*People) Validate

func (p *People) Validate(db *aorm.DB)

type Phone

type Phone struct {
	phone.Phone
	PeopleID bid.BID
}

type Plugin

type Plugin struct {
	plug.EventDispatcher
	db.DBNames
	admin_plugin.AdminNames
}

func (Plugin) After

func (Plugin) After() []interface{}

func (*Plugin) OnRegister

func (p *Plugin) OnRegister(e *plug.Options)

Jump to

Keyboard shortcuts

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