models

package
v0.0.0-...-c7bdee8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2013 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Time layout used to process DB datetime values.
	DbtimeLayout = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Id          int32     `json:"id" qbs:"pk,notnull"`
	Title       string    `json:"title"`
	Slug        string    `json:"slug"`
	Content     string    `json:"content"`
	Draft       bool      `json:"draft" qbs:"default:'true'"`
	CreatedAt   time.Time `json:"created_at" qbs:"notnull,created"`
	UpdatedAt   time.Time `json:"updated_at" qbs:"notnull,updated"`
	Aside       bool      `json:"aside"`
	Url         string    `json:"url"`
	Parent      int32     `json:"parent"`
	Timespent   int32     `json:"timespent"`
	PublishedAt time.Time `json:"published_at"`
	Page        bool      `json:"page"`
	External    bool      `qbs:"-"`
	NextPost    *Post     `qbs:"-"`
	PrevPost    *Post     `qbs:"-"`
}

Table name: posts

func (*Post) CreatedAtDateTime

func (p *Post) CreatedAtDateTime() string

func (*Post) Date

func (p *Post) Date() string

func (*Post) Equals

func (p *Post) Equals(post *Post) bool

func (*Post) PublishedAtDateTime

func (p *Post) PublishedAtDateTime() string

func (*Post) UpdatedAtDateTime

func (p *Post) UpdatedAtDateTime() string

func (*Post) Validate

func (p *Post) Validate(v *revel.Validation)

type User

type User struct {
	Id                          int32     `json:"id" qbs:"pk,notnull"`
	Username                    string    `json:"username" qbs:"notnull"`
	Email                       string    `json:"email"`
	CryptedPassword             string    `json:"crypted_password"`
	Salt                        string    `json:"salt"`
	CreatedAt                   time.Time `json:"created_at" qbs:"notnull,created"`
	UpdatedAt                   time.Time `json:"updated_at" qbs:"notnull,updated"`
	RememberMeToken             string    `json:"remember_me_token"`
	RememberMeTokenExpiresAt    time.Time `json:"remember_me_token_expires_at"`
	ResetPasswordToken          string    `json:"reset_password_token"`
	ResetPasswordTokenExpiresAt time.Time `json:"reset_password_token_expires_at"`
	ResetPasswordEmailSentAt    time.Time `json:"reset_password_email_sent_at"`
	LastLoginAt                 time.Time `json:"last_login_at"`
	LastLogoutAt                time.Time `json:"last_logout_at"`
	LastActivityAt              time.Time `json:"last_activity_at"`
	FailedLoginsCount           int32     `json:"failed_logins_count" qbs:"default:'0'"`
	LockExpiresAt               time.Time `json:"lock_expires_at"`
	Role                        string    `qbs:"-"`
}

Table name: users

Jump to

Keyboard shortcuts

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