models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListQuery

func ListQuery(dao *daos.Dao) *dbx.SelectQuery

func TaskQuery

func TaskQuery(dao *daos.Dao) *dbx.SelectQuery

Types

type List

type List struct {
	models.BaseModel

	// Fields
	Title       string         `db:"title"`
	Description string         `db:"description"`
	Archived    bool           `db:"archived"`
	Deadline    types.DateTime `db:"deadline"`

	// Relations
	OwnerId string         `db:"owner"`
	Owner   *models.Record `db:"-"`
	Tasks   []*Task        `db:"-"`

	// Computed
	Completed int `db:"-"`
}

func FindUserLists

func FindUserLists(dao *daos.Dao, id string) ([]*List, error)

FindUserLists finds all the todo lists associated to the user. It also finds all associated todo for every list

func GetListById

func GetListById(dao *daos.Dao, id string, expand bool) (*List, error)

func (*List) Save

func (l *List) Save(dao *daos.Dao) error

func (*List) TableName

func (*List) TableName() string

type Task

type Task struct {
	models.BaseModel

	// Fields
	Title       string         `db:"title"`
	Description string         `db:"description"`
	Done        bool           `db:"done"`
	Deadline    types.DateTime `db:"deadline"`

	// Relations
	ListId string `db:"list"`
	List   *List  `db:"-"`
}

func GetTaskById

func GetTaskById(dao *daos.Dao, id string) (*Task, error)

func (*Task) Save

func (t *Task) Save(dao *daos.Dao) error

func (*Task) TableName

func (*Task) TableName() string

Jump to

Keyboard shortcuts

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