status

package
v0.0.0-...-22be18f Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Draft       = 0
	Final       = 10
	Suspended   = 11
	Unavailable = 12
	Published   = 100
	Featured    = 101
)

Status values If these need to be substantially modified for a particular model, it may be better to move this into the model package concerned and modify as required

Variables

This section is empty.

Functions

func NotNull

func NotNull(q *query.Query) *query.Query

NotNull modifies the given query to select records which do not have null status

func Null

func Null(q *query.Query) *query.Query

Null modifies the given query to select records with null status

func Order

func Order(q *query.Query) *query.Query

Order modifies the given query to order records by status

func WhereDraft

func WhereDraft(q *query.Query) *query.Query

WhereDraft modifies the given query to select status draft

func WhereFeatured

func WhereFeatured(q *query.Query) *query.Query

WhereFeatured modifies the given query to select status Featured

func WhereFinal

func WhereFinal(q *query.Query) *query.Query

WhereFinal modifies the given query to select status Final

func WherePublished

func WherePublished(q *query.Query) *query.Query

WherePublished modifies the given query to select status Published

func WhereSuspended

func WhereSuspended(q *query.Query) *query.Query

WhereSuspended modifies the given query to select status Suspended

Types

type ModelStatus

type ModelStatus struct {
	Status int64
}

ModelStatus adds status to a model - this may in future be removed and moved into apps as it is frequently modified

func (*ModelStatus) IsDraft

func (m *ModelStatus) IsDraft() bool

IsDraft returns true if the status is Draft

func (*ModelStatus) IsFeatured

func (m *ModelStatus) IsFeatured() bool

IsFeatured returns true if the status is featured

func (*ModelStatus) IsFinal

func (m *ModelStatus) IsFinal() bool

IsFinal returns true if the status is Final

func (*ModelStatus) IsPublished

func (m *ModelStatus) IsPublished() bool

IsPublished returns true if the status is published *or over*

func (*ModelStatus) IsSuspended

func (m *ModelStatus) IsSuspended() bool

IsSuspended returns true if the status is Suspended

func (*ModelStatus) IsUnavailable

func (m *ModelStatus) IsUnavailable() bool

IsUnavailable returns true if the status is unavailable

func (*ModelStatus) StatusDisplay

func (m *ModelStatus) StatusDisplay() string

StatusDisplay returns a string representation of the model status

func (*ModelStatus) StatusOptions

func (m *ModelStatus) StatusOptions() []helpers.Option

StatusOptions returns an array of statuses for a status select

Jump to

Keyboard shortcuts

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