models

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATE_FORMAT     = "Jan _2, 2006"
	SQL_DATE_FORMAT = "2006-01-02"
)

Variables

This section is empty.

Functions

func ValidatePassword

func ValidatePassword(v *revel.Validation, password string) *revel.ValidationResult

Types

type Booking

type Booking struct {
	BookingId    int
	UserId       int
	HotelId      int
	CheckInStr   string
	CheckOutStr  string
	CardNumber   string
	NameOnCard   string
	CardExpMonth int
	CardExpYear  int
	Smoking      bool
	Beds         int

	// Transient
	CheckInDate  time.Time
	CheckOutDate time.Time
	User         *User
	Hotel        *Hotel
}

func (Booking) Description

func (b Booking) Description() string

func (Booking) Nights

func (b Booking) Nights() int

func (*Booking) PostGet

func (b *Booking) PostGet(exe gorp.SqlExecutor) error

func (*Booking) PreInsert

func (b *Booking) PreInsert(_ gorp.SqlExecutor) error

func (Booking) String

func (b Booking) String() string

func (Booking) Total

func (b Booking) Total() int

func (Booking) Validate

func (booking Booking) Validate(v *revel.Validation)

TODO: Make an interface for Validate() and then validation can pass in the key prefix ("booking.")

type Hotel

type Hotel struct {
	HotelId          int
	Name, Address    string
	City, State, Zip string
	Country          string
	Price            int
}

func (*Hotel) Validate

func (hotel *Hotel) Validate(v *revel.Validation)

type User

type User struct {
	UserId             int
	Name               string
	Username, Password string
	HashedPassword     []byte
}

func (*User) String

func (u *User) String() string

func (*User) Validate

func (user *User) Validate(v *revel.Validation)

Jump to

Keyboard shortcuts

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