Giter Club home page Giter Club logo

qor-example's Introduction

QOR example application

This is an example application to show and explain features of QOR.

Chat Room: Join the chat at https://gitter.im/qor/qor

Quick Started

Go version: 1.8+

# Get example app
$ go get -u github.com/qor/qor-example

# Setup database
# Or if you prefer postgreSQL see the postgres_env file for its configuration.
$ mysql -uroot -p
mysql> CREATE DATABASE qor_example;

# Run Application
$ cd $GOPATH/src/github.com/qor/qor-example
$ go run main.go

Generate sample data

$ go run config/db/seeds/main.go config/db/seeds/seeds.go

Run tests (Pending)

$ go test $(go list ./... | grep -v /vendor/ | grep  -v /db/)

Admin Management Interface

Qor Example admin configuration

Online Demo Website: demo.getqor.com/admin

RESTful API

Qor Example API configuration

Online Example APIs:

License

Released under the MIT License.

@QORSDK

qor-example's People

Contributors

anatole avatar azumads avatar binku87 avatar bodhi avatar chenxin0723 avatar dependabot[bot] avatar ericwo avatar fvbock avatar glavposhtamt avatar grengojbo avatar han2015 avatar jasonweng avatar jeweller-tsai avatar jinzhu avatar joelchen avatar junhuif avatar mklebrasseur avatar muhammadn avatar netroby avatar raven-chen avatar shenzhaoyan avatar sunfmin avatar swrdfish avatar teachmefly avatar wtser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qor-example's Issues

support persian language fa-IR

hi...
I trying to save persian text to db but i get this error...
Error 1366: Incorrect string value: '\xD8\xB4\xD8\xB3\xDB\x8C...' for column 'name' at row 1
can any one help me...?
tnx

Full featured example app

It would be nice to see full featured example app.
With working orders, checkout, cart etc.
I think it is most important feature and it would attract more contributors to QOR SDK

New user email confirm throws error

I got this link in my test email to confirm user email

http://localhost:7000/auth/confirm?cnf=IErSvqTtOtVo5YnxQKLeoZTfl0y5WMh6XS_maq7MWmo%3D

and when I click on it I get this error :

go run main.go
Failed to find configuration config/smtp.yml, using example file config/smtp.example.yml
Failed to find configuration config/database.yml, using example file config/database.example.yml
Failed to create unique index for translations key & locale, got: Error 1170: BLOB/TEXT column 'key' used in key specification without a key length

(Error 1170: BLOB/TEXT column 'key' used in key specification without a key length)
[2017-04-28 19:21:09]
[auth]     Loading
[confirm]  Loading
[recover]  Loading
[register] Loading
[warning] duplicated callback `qor_admin:composite_primary_key` from /Users/z001r9y/go/src/github.com/qor/admin/composite_primary_key_callback.go:31
[warning] duplicated callback `qor_admin:composite_primary_key` from /Users/z001r9y/go/src/github.com/qor/admin/composite_primary_key_callback.go:32
[warning] duplicated callback `qor_admin:composite_primary_key` from /Users/z001r9y/go/src/github.com/qor/admin/composite_primary_key_callback.go:32
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /                         --> github.com/qor/qor-example/app/controllers.HomeIndex (4 handlers)
[GIN-debug] GET    /products/:code           --> github.com/qor/qor-example/app/controllers.ProductShow (4 handlers)
[GIN-debug] GET    /category/:code           --> github.com/qor/qor-example/app/controllers.CategoryShow (4 handlers)
[GIN-debug] GET    /switch_locale            --> github.com/qor/qor-example/app/controllers.SwitchLocale (4 handlers)
[auth]     Route: /auth/login
[auth]     Route: /auth/logout
[confirm]  Route: /auth/confirm
[recover]  Route: /auth/recover
[recover]  Route: /auth/recover/complete
[register] Route: /auth/register
Listening on: 7000




http: panic serving [::1]:55106: reflect: Call using zero Value argument
goroutine 784 [running]:
net/http.(*conn).serve.func1(0xc4210f9d60)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1721 +0xd0
panic(0x1701e80, 0xc421127930)
	/usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:489 +0x2cf
reflect.Value.call(0x173eb80, 0xc421146840, 0x213, 0x17f8a90, 0x4, 0xc4210cb600, 0x1, 0x1, 0xc42000e3e8, 0x13, ...)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:366 +0x113d
reflect.Value.Call(0x173eb80, 0xc421146840, 0x213, 0xc4210cb600, 0x1, 0x1, 0xc421146840, 0x213, 0x1778fa0)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:302 +0xa4
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.Attributes.Bind(0xc42115ac00, 0x1740800, 0xc4211467e0, 0x1, 0x0, 0x0)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/storer.go:296 +0x6e8
github.com/qor/qor-example/config/auth.AuthStorer.Put(0xc421126f41, 0x9, 0xc42115ac00, 0x9, 0xc42115e240)
	/Users/z001r9y/go/src/github.com/qor/qor-example/config/auth/db_storer.go:30 +0x19a
github.com/qor/qor-example/config/auth.(*AuthStorer).Put(0x1d4ef78, 0xc421126f41, 0x9, 0xc42115ac00, 0xc42115e2d8, 0xc4210cb801)
	<autogenerated>:2 +0x63
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*Context).SaveUser(0xc420f21b00, 0x17fa0df, 0x5)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/context.go:109 +0x134
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).confirmHandler(0xc42022fd60, 0xc420f21b00, 0x1b72740, 0xc421146000, 0xc421144300, 0x1b720c0, 0xc421108fe0)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:196 +0x537
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).(github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.confirmHandler)-fm(0xc420f21b00, 0x1b72740, 0xc421146000, 0xc421144300, 0xc420f21b00, 0xc421122900)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:86 +0x52
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.contextRoute.ServeHTTP(0xc4200a8780, 0xc4211248d0, 0x1b72740, 0xc421146000, 0xc421144300)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/router.go:58 +0xee
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*contextRoute).ServeHTTP(0xc421124970, 0x1b72740, 0xc421146000, 0xc421144300)
	<autogenerated>:124 +0x74
net/http.(*ServeMux).ServeHTTP(0xc421122930, 0x1b72740, 0xc421146000, 0xc421144300)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc421122900, 0x1b72740, 0xc421146000, 0xc421144300)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc4211227e0, 0x1b72740, 0xc421146000, 0xc421144300)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
github.com/gorilla/csrf.(*csrf).ServeHTTP(0xc4210f9cc0, 0x1b72740, 0xc421146000, 0xc421144300)
	/Users/z001r9y/go/src/github.com/gorilla/csrf/csrf.go:267 +0x32d
main.main.func1.1(0x1b72740, 0xc421146000, 0xc420294c00)
	/Users/z001r9y/go/src/github.com/qor/qor-example/main.go:37 +0x73
net/http.HandlerFunc.ServeHTTP(0xc420f2bc00, 0x1b72740, 0xc421146000, 0xc420294c00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1942 +0x44
net/http.serverHandler.ServeHTTP(0xc421117340, 0x1b72740, 0xc421146000, 0xc420294c00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc4210f9d60, 0x1b73140, 0xc421110bc0)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2668 +0x2ce
http: panic serving [::1]:55107: reflect: Call using zero Value argument
goroutine 785 [running]:
net/http.(*conn).serve.func1(0xc4210f9e00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1721 +0xd0
panic(0x1701e80, 0xc421188e10)
	/usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:489 +0x2cf
reflect.Value.call(0x173eb80, 0xc421147720, 0x213, 0x17f8a90, 0x4, 0xc4210cb600, 0x1, 0x1, 0xc42000e700, 0x13, ...)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:366 +0x113d
reflect.Value.Call(0x173eb80, 0xc421147720, 0x213, 0xc4210cb600, 0x1, 0x1, 0xc421147720, 0x213, 0x1778fa0)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:302 +0xa4
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.Attributes.Bind(0xc421186ab0, 0x1740800, 0xc4211476c0, 0x1, 0x0, 0x0)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/storer.go:296 +0x6e8
github.com/qor/qor-example/config/auth.AuthStorer.Put(0xc4211883d1, 0x9, 0xc421186ab0, 0x9, 0xc42115e900)
	/Users/z001r9y/go/src/github.com/qor/qor-example/config/auth/db_storer.go:30 +0x19a
github.com/qor/qor-example/config/auth.(*AuthStorer).Put(0x1d4ef78, 0xc4211883d1, 0x9, 0xc421186ab0, 0xc42115e998, 0xc4210cb801)
	<autogenerated>:2 +0x63
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*Context).SaveUser(0xc421162500, 0x17fa0df, 0x5)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/context.go:109 +0x134
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).confirmHandler(0xc42022fd60, 0xc421162500, 0x1b72740, 0xc421146ee0, 0xc421144600, 0x1b720c0, 0xc42116e260)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:196 +0x537
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).(github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.confirmHandler)-fm(0xc421162500, 0x1b72740, 0xc421146ee0, 0xc421144600, 0xc421162500, 0xc421122900)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:86 +0x52
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.contextRoute.ServeHTTP(0xc4200a8780, 0xc4211248d0, 0x1b72740, 0xc421146ee0, 0xc421144600)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/router.go:58 +0xee
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*contextRoute).ServeHTTP(0xc421124970, 0x1b72740, 0xc421146ee0, 0xc421144600)
	<autogenerated>:124 +0x74
net/http.(*ServeMux).ServeHTTP(0xc421122930, 0x1b72740, 0xc421146ee0, 0xc421144600)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc421122900, 0x1b72740, 0xc421146ee0, 0xc421144600)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc4211227e0, 0x1b72740, 0xc421146ee0, 0xc421144600)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
github.com/gorilla/csrf.(*csrf).ServeHTTP(0xc4210f9cc0, 0x1b72740, 0xc421146ee0, 0xc421144600)
	/Users/z001r9y/go/src/github.com/gorilla/csrf/csrf.go:267 +0x32d
main.main.func1.1(0x1b72740, 0xc421146ee0, 0xc421144000)
	/Users/z001r9y/go/src/github.com/qor/qor-example/main.go:37 +0x73
net/http.HandlerFunc.ServeHTTP(0xc420f2bc00, 0x1b72740, 0xc421146ee0, 0xc421144000)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1942 +0x44
net/http.serverHandler.ServeHTTP(0xc421117340, 0x1b72740, 0xc421146ee0, 0xc421144000)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc4210f9e00, 0x1b73140, 0xc420f217c0)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2668 +0x2ce
http: panic serving [::1]:55108: reflect: Call using zero Value argument
goroutine 818 [running]:
net/http.(*conn).serve.func1(0xc4210f9ea0)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1721 +0xd0
panic(0x1701e80, 0xc4211ac330)
	/usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:489 +0x2cf
reflect.Value.call(0x173eb80, 0xc4211a2680, 0x213, 0x17f8a90, 0x4, 0xc4210cb600, 0x1, 0x1, 0xc42000ebc0, 0x13, ...)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:366 +0x113d
reflect.Value.Call(0x173eb80, 0xc4211a2680, 0x213, 0xc4210cb600, 0x1, 0x1, 0xc4211a2680, 0x213, 0x1778fa0)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:302 +0xa4
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.Attributes.Bind(0xc4211a87e0, 0x1740800, 0xc4211a2620, 0x1, 0x0, 0x0)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/storer.go:296 +0x6e8
github.com/qor/qor-example/config/auth.AuthStorer.Put(0xc4211898c1, 0x9, 0xc4211a87e0, 0x9, 0xc42115f0d0)
	/Users/z001r9y/go/src/github.com/qor/qor-example/config/auth/db_storer.go:30 +0x19a
github.com/qor/qor-example/config/auth.(*AuthStorer).Put(0x1d4ef78, 0xc4211898c1, 0x9, 0xc4211a87e0, 0xc42115f168, 0xc4210cb801)
	<autogenerated>:2 +0x63
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*Context).SaveUser(0xc421162cc0, 0x17fa0df, 0x5)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/context.go:109 +0x134
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).confirmHandler(0xc42022fd60, 0xc421162cc0, 0x1b72740, 0xc421147dc0, 0xc421144900, 0x1b720c0, 0xc42116f440)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:196 +0x537
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).(github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.confirmHandler)-fm(0xc421162cc0, 0x1b72740, 0xc421147dc0, 0xc421144900, 0xc421162c00, 0xc421122900)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:86 +0x52
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.contextRoute.ServeHTTP(0xc4200a8780, 0xc4211248d0, 0x1b72740, 0xc421147dc0, 0xc421144900)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/router.go:58 +0xee
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*contextRoute).ServeHTTP(0xc421124970, 0x1b72740, 0xc421147dc0, 0xc421144900)
	<autogenerated>:124 +0x74
net/http.(*ServeMux).ServeHTTP(0xc421122930, 0x1b72740, 0xc421147dc0, 0xc421144900)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc421122900, 0x1b72740, 0xc421147dc0, 0xc421144900)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc4211227e0, 0x1b72740, 0xc421147dc0, 0xc421144900)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
github.com/gorilla/csrf.(*csrf).ServeHTTP(0xc4210f9cc0, 0x1b72740, 0xc421147dc0, 0xc421144900)
	/Users/z001r9y/go/src/github.com/gorilla/csrf/csrf.go:267 +0x32d
main.main.func1.1(0x1b72740, 0xc421147dc0, 0xc421007e00)
	/Users/z001r9y/go/src/github.com/qor/qor-example/main.go:37 +0x73
net/http.HandlerFunc.ServeHTTP(0xc420f2bc00, 0x1b72740, 0xc421147dc0, 0xc421007e00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1942 +0x44
net/http.serverHandler.ServeHTTP(0xc421117340, 0x1b72740, 0xc421147dc0, 0xc421007e00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc4210f9ea0, 0x1b73140, 0xc42112a540)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2668 +0x2ce
http: panic serving [::1]:55109: reflect: Call using zero Value argument
goroutine 834 [running]:
net/http.(*conn).serve.func1(0xc420ef8460)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1721 +0xd0
panic(0x1701e80, 0xc4211ad780)
	/usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:489 +0x2cf
reflect.Value.call(0x173eb80, 0xc4211a3560, 0x213, 0x17f8a90, 0x4, 0xc4210cb600, 0x1, 0x1, 0xc42000ee08, 0x13, ...)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:366 +0x113d
reflect.Value.Call(0x173eb80, 0xc4211a3560, 0x213, 0xc4210cb600, 0x1, 0x1, 0xc4211a3560, 0x213, 0x1778fa0)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:302 +0xa4
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.Attributes.Bind(0xc4211c4570, 0x1740800, 0xc4211a3500, 0x1, 0x0, 0x0)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/storer.go:296 +0x6e8
github.com/qor/qor-example/config/auth.AuthStorer.Put(0xc4211acde1, 0x9, 0xc4211c4570, 0x9, 0xc42115f680)
	/Users/z001r9y/go/src/github.com/qor/qor-example/config/auth/db_storer.go:30 +0x19a
github.com/qor/qor-example/config/auth.(*AuthStorer).Put(0x1d4ef78, 0xc4211acde1, 0x9, 0xc4211c4570, 0xc42115f708, 0xc4210cb801)
	<autogenerated>:2 +0x63
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*Context).SaveUser(0xc4211635c0, 0x17fa0df, 0x5)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/context.go:109 +0x134
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).confirmHandler(0xc42022fd60, 0xc4211635c0, 0x1b72740, 0xc4211a2d20, 0xc421144d00, 0x1b720c0, 0xc4211aa660)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:196 +0x537
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).(github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.confirmHandler)-fm(0xc4211635c0, 0x1b72740, 0xc4211a2d20, 0xc421144d00, 0xc421163500, 0xc421122900)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:86 +0x52
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.contextRoute.ServeHTTP(0xc4200a8780, 0xc4211248d0, 0x1b72740, 0xc4211a2d20, 0xc421144d00)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/router.go:58 +0xee
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*contextRoute).ServeHTTP(0xc421124970, 0x1b72740, 0xc4211a2d20, 0xc421144d00)
	<autogenerated>:124 +0x74
net/http.(*ServeMux).ServeHTTP(0xc421122930, 0x1b72740, 0xc4211a2d20, 0xc421144d00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc421122900, 0x1b72740, 0xc4211a2d20, 0xc421144d00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc4211227e0, 0x1b72740, 0xc4211a2d20, 0xc421144d00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
github.com/gorilla/csrf.(*csrf).ServeHTTP(0xc4210f9cc0, 0x1b72740, 0xc4211a2d20, 0xc421144d00)
	/Users/z001r9y/go/src/github.com/gorilla/csrf/csrf.go:267 +0x32d
main.main.func1.1(0x1b72740, 0xc4211a2d20, 0xc421144a00)
	/Users/z001r9y/go/src/github.com/qor/qor-example/main.go:37 +0x73
net/http.HandlerFunc.ServeHTTP(0xc420f2bc00, 0x1b72740, 0xc4211a2d20, 0xc421144a00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1942 +0x44
net/http.serverHandler.ServeHTTP(0xc421117340, 0x1b72740, 0xc4211a2d20, 0xc421144a00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc420ef8460, 0x1b73140, 0xc421163340)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2668 +0x2ce
http: panic serving [::1]:55115: reflect: Call using zero Value argument
goroutine 838 [running]:
net/http.(*conn).serve.func1(0xc420ef8640)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1721 +0xd0
panic(0x1701e80, 0xc4211e8c40)
	/usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:489 +0x2cf
reflect.Value.call(0x173eb80, 0xc4211e44c0, 0x213, 0x17f8a90, 0x4, 0xc4210cb600, 0x1, 0x1, 0xc42000f050, 0x13, ...)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:366 +0x113d
reflect.Value.Call(0x173eb80, 0xc4211e44c0, 0x213, 0xc4210cb600, 0x1, 0x1, 0xc4211e44c0, 0x213, 0x1778fa0)
	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:302 +0xa4
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.Attributes.Bind(0xc4211ea2a0, 0x1740800, 0xc4211e4460, 0x1, 0x0, 0x0)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/storer.go:296 +0x6e8
github.com/qor/qor-example/config/auth.AuthStorer.Put(0xc4211e8241, 0x9, 0xc4211ea2a0, 0x9, 0xc42115fe50)
	/Users/z001r9y/go/src/github.com/qor/qor-example/config/auth/db_storer.go:30 +0x19a
github.com/qor/qor-example/config/auth.(*AuthStorer).Put(0x1d4ef78, 0xc4211e8241, 0x9, 0xc4211ea2a0, 0xc42115fee8, 0xc4210cb801)
	<autogenerated>:2 +0x63
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*Context).SaveUser(0xc421163ec0, 0x17fa0df, 0x5)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/context.go:109 +0x134
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).confirmHandler(0xc42022fd60, 0xc421163ec0, 0x1b72740, 0xc4211a3c00, 0xc421145100, 0x1b720c0, 0xc4211ab820)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:196 +0x537
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).(github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.confirmHandler)-fm(0xc421163ec0, 0x1b72740, 0xc4211a3c00, 0xc421145100, 0xc421163e00, 0xc421122900)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:86 +0x52
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.contextRoute.ServeHTTP(0xc4200a8780, 0xc4211248d0, 0x1b72740, 0xc4211a3c00, 0xc421145100)
	/Users/z001r9y/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/router.go:58 +0xee
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*contextRoute).ServeHTTP(0xc421124970, 0x1b72740, 0xc4211a3c00, 0xc421145100)
	<autogenerated>:124 +0x74
net/http.(*ServeMux).ServeHTTP(0xc421122930, 0x1b72740, 0xc4211a3c00, 0xc421145100)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc421122900, 0x1b72740, 0xc4211a3c00, 0xc421145100)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
net/http.(*ServeMux).ServeHTTP(0xc4211227e0, 0x1b72740, 0xc4211a3c00, 0xc421145100)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2238 +0x130
github.com/gorilla/csrf.(*csrf).ServeHTTP(0xc4210f9cc0, 0x1b72740, 0xc4211a3c00, 0xc421145100)
	/Users/z001r9y/go/src/github.com/gorilla/csrf/csrf.go:267 +0x32d
main.main.func1.1(0x1b72740, 0xc4211a3c00, 0xc421144e00)
	/Users/z001r9y/go/src/github.com/qor/qor-example/main.go:37 +0x73
net/http.HandlerFunc.ServeHTTP(0xc420f2bc00, 0x1b72740, 0xc4211a3c00, 0xc421144e00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1942 +0x44
net/http.serverHandler.ServeHTTP(0xc421117340, 0x1b72740, 0xc4211a3c00, 0xc421144e00)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc420ef8640, 0x1b73140, 0xc421163c40)
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.8/libexec/src/net/http/server.go:2668 +0x2ce

run qor-example from executable

Hi! thanks for sharing this awesome sdk 👍

by the way, is there a way to run qor-example from go executable built with go build?

I have no frontend and only admin interface working while running executable

Also I've tried --compile-qor-template and building using tag bindatafs with no luck 😟

Consuming API with REST client gives error on CSRF

Hi, I setted up the qor-example project in my local enviroment and everuthing is working, however when I consume the API using Postman I get Could not authorize you because 'CSRF detected' I know that there's a middleware that gives this error, but then why I can only make GET petitions?

But, if I consume the API with curl from the CLI it seems to works fine, I sent for example:

curl -i -X DELETE --url http://localhost:7000/admin/colors/1 --header 'Accept:text/xml'

After installed qor-example product section not working in the admin backend

←[35m(Error 1146: Table 'qor_example.products' doesn't exist)←[0m
←[33m[2016-05-05 13:34:58]←[0m ←[31;1m ←[0m
[WARNING] Qor SEO: The parameter you passed is not a Struct

←[35m(Error 1146: Table 'qor_example.products' doesn't exist)←[0m
←[33m[2016-05-05 13:34:58]←[0m ←[31;1m ←[0m
[GIN] 2016/05/05 - 13:34:58 |←[97;42m 200 ←[0m| 62.5ms | ::1 |←[97;44m ←
[0m GET /
When i run main.go it shows these below errors
←[35m(Error 1146: Table 'qor_example.products' doesn't exist)←[0m
←[33m[2016-05-05 13:34:58]←[0m ←[31;1m ←[0m
[WARNING] Qor SEO: The parameter you passed is not a Struct
[GIN] 2016/05/05 - 13:34:58 |←[97;42m 200 ←[0m| 62.4987ms | ::1 |←[97;44m ←
[0m GET /

←[35m(Error 1146: Table 'qor_example.products' doesn't exist)←[0m
←[33m[2016-05-05 13:34:58]←[0m ←[31;1m ←[0m
Finish [GET] /admin/widgets/inline-edit Took 31.24ms

Generate sample data -> sample image download error

Error at $ go run db/seeds/main.go :

open file ("http://qor3.s3.amazonaws.com/01-tee-c.20160316044516567824937.png") failure, got err open /home/caghan/Development/go-work/src/github.com/qor/qor-example/tmp/01-tee-c.20160316044516567824937.png: no such file or directory

It is because the folder tmp doesn't exist in the repo tree. So you may fix it by adding tmp folder to root of example.

mkdir $GOPATH/src/github.com/qor/qor-example/tmp

P.S. BTW qor seems promising! 💯

inaccessibility ordinary users

hi...
i want to prevent ordinary users to get to admin panel...
like redirect them or showing 404 error or...
what should i have done?
thanks

Can't Run Demo Code

Steps used:

  • go get -u github.com/qor/qor
  • go get -u github.com/qor/qor-example
  • create MySQL database
  • insert credentials to qor-example/config/database.yml
  • insert credentials to qor-example/config/smtp.yml
  • go run db/seeds/main.go --> failed

Error:

# github.com/qor/admin
../admin/searcher.go:194: cannot use int(s.Pagination.PerPage) (type int) as type int64 in argument to db.Limit
../admin/searcher.go:194: cannot use (int(s.Pagination.CurrentPage) - 1) * int(s.Pagination.PerPage) (type int) as type int64 in argument to db.Limit(int(s.Pagination.PerPage)).Offset

Try Fixing:
add casting to int64 on s.Pagination.CurrentPage and s.Pagination.PerPage (line 194)

  • re-run go run db/seeds/main.go --> success
  • go run main.go --> failed

Error:

# github.com/qor/qor-example/config/auth
config/auth/auth.go:35: Auth.LayoutPath undefined (type *authboss.Authboss has no field or method LayoutPath)
config/auth/auth.go:36: Auth.LayoutFuncMaker undefined (type *authboss.Authboss has no field or method LayoutFuncMaker)

Try Fixing:
comment out qor-example/config/auth/auth.go line 35 and 36

  • re-run go run main.go

Error:

[info] replacing callback `gorm:delete` from /home/ubuntu/qorsdk/src/github.com/qor/publish/publish.go:144
Failed to create unique index for translations key & locale, got: Error 1170: BLOB/TEXT column 'key' used in key specification without a key length

(Error 1170: BLOB/TEXT column 'key' used in key specification without a key length)
[2016-06-16 14:35:50]
[register] Loading
panic: [register] Error Initializing: template: authboss:8: function "t" not defined

goroutine 1 [running]:
github.com/qor/qor-example/config/auth.init.1()
    /home/ubuntu/qorsdk/src/github.com/qor/qor-example/config/auth/auth.go:58 +0x6a9
github.com/qor/qor-example/config/auth.init()
    /home/ubuntu/qorsdk/src/github.com/qor/qor-example/config/auth/session_storer.go:69 +0xd3
github.com/qor/qor-example/config/admin.init()
    /home/ubuntu/qorsdk/src/github.com/qor/qor-example/config/admin/worker.go:133 +0x7b
main.init()
    /home/ubuntu/qorsdk/src/github.com/qor/qor-example/main.go:29 +0x4a

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 5 [chan receive]:
database/sql.(*DB).connectionOpener(0xc820272f00)
    /usr/local/go/src/database/sql/sql.go:634 +0x45
created by database/sql.Open
    /usr/local/go/src/database/sql/sql.go:481 +0x336
exit status 2

Anyone can help what I'm missing or what could I do to fix this?

Sorting mode is not working

It seems the sorting mode is not working. Neither in desktop Chrome nor in mobile Chrome. Or I miss something?

Error 1170: BLOB/TEXT column 'key' used in key specification without a key length

i try to run the demo, but when i run:

# this ok:
go get ./db/seeds/...

# happened an error:
go run db/seeds/main.go

the full log:

xx@mac [15时17分56秒] [~/xx/iGoSpace/src/github.com/qor/qor-example] [master]
-> % go run db/seeds/main.go

Failed to find configuration config/smtp.yml, using example file config/smtp.example.yml
Failed to find configuration config/database.yml, using example file config/database.example.yml
[info] replacing callback `gorm:delete` from /Users/xx/iGit/iGoSpace/src/github.com/qor/publish/publish.go:147
Failed to create unique index for translations key & locale, got: Error 1170: BLOB/TEXT column 'key' used in key specification without a key length

(Error 1170: BLOB/TEXT column 'key' used in key specification without a key length)

[2016-09-20 15:18:09]
[auth]     Loading
[confirm]  Loading
[recover]  Loading
[register] Loading
Start create sample data...
--> Created setting.
--> Created seo.
--> Created admin users.
--> Created users.
--> Created addresses.
--> Created categories.
--> Created collections.
--> Created colors.
--> Created sizes.
----> Downloaded http://qor3.s3.amazonaws.com/01-tee-c.20160316044516567824937.png
----> Downloaded http://qor3.s3.amazonaws.com/02-jacket-a.20160316042916412393755.png
----> Downloaded http://qor3.s3.amazonaws.com/03-hoodie-a.20160316050016575943551.png
----> Downloaded http://qor3.s3.amazonaws.com/04-watch-a.20160316055316228073566.png
----> Downloaded http://qor3.s3.amazonaws.com/05-watch-a.20160316050616453080832.png
----> Downloaded http://qor3.s3.amazonaws.com/06-watch-b.20160316051716100503633.png
----> Downloaded http://qor3.s3.amazonaws.com/07-necktie-b.20160316054316215346502.png
----> Downloaded http://qor3.s3.amazonaws.com/08-shoes-d.20160316053316367027290.png
----> Downloaded http://qor3.s3.amazonaws.com/9-book-c.20160316055616619095831.png
----> Downloaded http://qor3.s3.amazonaws.com/10-iphone-case-a.20160316050116186604394.png
----> Downloaded http://qor3.s3.amazonaws.com/11-mousepad-a.20160316061516297102890.png
--> Created products.
--> Created stores.
--> Created orders.
----> Downloaded http://qor3.s3.amazonaws.com/google_banner.jpg
----> Downloaded http://qor3.s3.amazonaws.com/qor_logo.png
----> Downloaded http://qor3.s3.amazonaws.com/slide1.jpg
----> Downloaded http://qor3.s3.amazonaws.com/slide2.jpg
----> Downloaded http://qor3.s3.amazonaws.com/slide3.jpg
--> Created widgets.
--> Done!

the error:

(Error 1170: BLOB/TEXT column 'key' used in key specification without a key length)

i am new to this project, should i care about this error, or just ignore it ?

Add sqlite support

I think sqlite easier and more faster way for development purposes.

It's very easy to add sqlite3 support with import gorm/dialects/sqlite inside db/db.go
and new adapter config

if config.Config.DB.Adapter == "sqlite" {
	DB, err = gorm.Open("sqlite3", fmt.Sprintf("%v\\%v.sqlite3", os.TempDir(), dbConfig.Name))
}

But it depends on mattn/go-sqlite3 wich needs gcc available on path.

I've got msys2 with mingw-w64-x86_64-toolchain on my Windows 7 machine and it works perfect for me.

Error 1170 and Error 1366

after run # go run db/seeds/main.go db/seeds/seeds.go
error info:
Failed to find configuration config/smtp.yml, using example file config/smtp.example.yml
Failed to find configuration config/database.yml, using example file config/database.example.yml
[info] replacing callback gorm:delete from /root/gopath/src/github.com/qor/publish/publish.go:147
Failed to create unique index for translations key & locale, got: Error 1170: BLOB/TEXT column 'key'
used in key specification without a key length
(Error 1170: BLOB/TEXT column 'key' used in key specification without a key length)
...
----> Downloaded http://qor3.s3.amazonaws.com/01-tee-c.20160316044516567824937.png

(Error 1366: Incorrect string value: '\xE6\x81\xA4' for column 'name' at row 1)
[2016-10-12 12:21:48]
----> Downloaded http://qor3.s3.amazonaws.com/02-jacket-a.20160316042916412393755.png

(Error 1366: Incorrect string value: '\xE5\xA4\xB9\xE5\x85\x8B...' for column 'name' at row 1)
[2016-10-12 12:21:51]

Missing functions on i18n.I18n

Looks like this commit is using a different version/branch of github.com/qor/qor/i18n?

github.com/qor/qor-example/config/funcMap.go:14: Config.I18n.EnableInlineEdit undefined (type *i18n.I18n has no field or method EnableInlineEdit)
github.com/qor/qor-example/config/funcMap.go:18: undefined: i18n.RenderInlineEditAssets

ERROR run

[auth] Route: /auth/logout

Duplicated meta Name defined for resource Widget Content
goroutine 1 [running]:
runtime/debug.Stack(0x2d, 0xc420a89770, 0x2)
/usr/local/opt/go/libexec/src/runtime/debug/stack.go:24 +0x79
runtime/debug.PrintStack()
/usr/local/opt/go/libexec/src/runtime/debug/stack.go:16 +0x22
github.com/qor/qor/utils.ExitWithMsg(0x674880, 0xc420e54c90, 0xc420a89770, 0x2, 0x2)
/Users/jbo/go/src/github.com/qor/qor/utils/utils.go:152 +0x161
github.com/qor/admin.(_Resource).Meta(0xc4209d5040, 0xc420109d40, 0xc420a89820)
/Users/jbo/go/src/github.com/qor/admin/resource.go:45 +0x2f1
github.com/qor/widget.(_QorWidgetSetting).ConfigureQorResource(0xc4208c4a80, 0xa72e80, 0xc4209d5040)
/Users/jbo/go/src/github.com/qor/widget/setting.go:131 +0x13e
github.com/qor/admin.(_Resource).configure(0xc4209d5040)
/Users/jbo/go/src/github.com/qor/admin/resource.go:497 +0x21b
github.com/qor/admin.(_Admin).MountTo(0xc420170000, 0x756fbd, 0x6, 0xc420ad7290)
/Users/jbo/go/src/github.com/qor/admin/route.go:268 +0x262
main.main()
/Users/jbo/go/src/github.com/qor/qor-example/main.go:20 +0xc3
Listening on: 7000

No edit functionality with single-Edit

The edit function does not work in case of using a single-edit mode.
The single edit Meta references a "signle-edit" class, that is not found in the CSS files. A test with single-edit instead has also no edit function.

Subcategories not showing in resource.

In app/models/category.go the Category struct holds a splice of categories.

I expect that this should hold subcategories. However it currently results in the error:

    The results could not be loaded.

which comes from qor/admin/views/assets/javascripts/vendors.js

In config/admin/admin.go the following code for doing this selection seems correct.

    category.Meta(&admin.Meta{Name: "Categories", Type: "select_many"})

No \tmp dir on windows, seeds.go can't download products and slideshow images

open file ("http://qor3.s3.amazonaws.com/01-tee-c.20160316044516567824937.png") failure, got err open \tmp\01-tee-c.20160316044516567824937.png: The system cannot find the path specified.
open file ("banner") failure, got err open \tmp\google_banner.jpg: The system cannot find the path specified.
open file ("qor_logo") failure, got err open \tmp\qor_logo.png: The system cannot find the path specified.
open file ("banner") failure, got err open \tmp\slide1.jpg: The system cannot find the path specified.

if I change method openFileByURL in db\seeds\main.go to:

filepath.Join("", fileName)

it will pollute qor-example folder (from wich I've run go run db/seeds/main.go db/seeds/seeds.go), but put all of downloaded images inside public/system folder and example works fine

When I'am trying to use filepath.Join(os.TempDir(), fileName), products works just fine, but slideshow images doesn't, they even doesn't copied in folder public/system and url in html is:

/system/qor_widget_settings/TopBanner/image/C:%5cUsers%5cMIRONO~1%5cAppData%5cLocal%5cTemp%5cslide1.20170206133517827284700.jpg

Workers Select not works

Demo app Workers click + (button)
Add Worker -> click Export Translations or other admin.SelectOneConfig...

Is not display list items
workers_select_error

edit fields by roles

How do I edit different fields with different roles?
for example
role admin:
EditAttrs("role"....)

role user:
EditAttrs("password", "email" .....)

role manager:
EditAttrs("point"...)

Use SQLite for demo app?

Is there any reason you're using MySQL instead of SQLite for the demo app? It would be much faster to get started using QOR if it just used a file in SQLite instead of having to setup a new MySQL database.

demo account doesnt work in localhost

I cloned this repo and run it, but when I enter the demo user cred it wont login. (username [email protected] and password testing)
I get this message

invalid email and/or password

the demo user/pass works on the hosted demo on your website but not locally. why?

I tried to create a new user myself but I got into this other issue #79

Can not update a product when used in a new model

I created the following model:

product_map.go

package models

import (
	"strings"

	"github.com/jinzhu/gorm"
	"github.com/qor/sorting"
	"github.com/qor/validations"
)

//ProductMap maps products with
type ProductMap struct {
	gorm.Model
	sorting.Sorting
	ProductID   uint
	Product     Product
	StoreID     uint
	LatestPrice float32 `l10n:"sync"`
	Store       Store
	Name        string
	URL         string
	SaleUnit    string
	TotalUnits  float32
	Currency    string
}

//Validate input should be valid
func (o ProductMap) Validate(db *gorm.DB) {
	if strings.TrimSpace(o.Name) == "" {
		db.AddError(validations.NewError(o, "Name", "Name can not be empty"))
	}

	if strings.TrimSpace(o.URL) == "" {
		db.AddError(validations.NewError(o, "URL", "Product URL can not be empty"))
	}

	if o.ProductID <= 0 {
		db.AddError(validations.NewError(o, "Product", "Product can not be empty"))
	}

	if o.StoreID <= 0 {
		db.AddError(validations.NewError(o, "Store", "Store can not be empty"))
	}
}

Then in admin.go added:

	productMap := Admin.AddResource(&models.ProductMap{}, &admin.Config{Menu: []string{"Store Management"}})
	productMap.Meta(&admin.Meta{Name: "Product", Permission: roles.Allow(roles.Update, "admin")})

However in the admin panel when I try to edit a "ProductMap", a select box with all the products in the DB is displayed but I'm not able to select a Product (the rest of the "ProductMap" fields are editable).

Any advice would be appreciated

categories issue

When modify the categories in the "Edit category page", the program run endless loop, the code is related to "/qor/resource/meta.go:203".

Error 1406: Data too long for column 'cover_image' at row 1

(/Users/sunfmin/gopkg/src/github.com/qor/qor/publish/callbacks.go:90) 
[2015-07-23 13:48:43]  [0.31ms]  DELETE FROM `book_authors_draft`  WHERE (`book_id` = '1' AND `author_id` NOT IN ('1'))

(/Users/sunfmin/gopkg/src/github.com/qor/qor/resource/curd.go:26) 
[2015-07-23 13:48:43]  Error 1406: Data too long for column 'cover_image' at row 1 

(/Users/sunfmin/gopkg/src/github.com/qor/qor/resource/curd.go:26) 
[2015-07-23 13:48:43]  [1.24ms]  UPDATE `books_draft` SET `price` = '0', `cover_image` = '{"FileName":"20508106.jpg-r_640_600-b_1_D6D6D6-f_jpg-q_x-xxyxx.jpg","Url":"/system/books_draft/1/CoverImage/20508106.jpg-r_640_600-b_1_D6D6D6-f_jpg-q_x-xxyxx.20150723134315224807856.jpg","CropOptions":{"original":{"X":135,"Y":11,"Width":360,"Height":284}}}', `updated_at` = '2015-07-23T13:48:43+08:00', `deleted_at` = '<nil>', `synopsis` = '', `created_at` = '2015-07-23T13:48:10+08:00', `publish_status` = 'true', `title` = '关于Qor的新书', `release_date` = '2015-07-15T00:00:00+08:00'  WHERE (`id` = '1') AND ((language_code = 'en-US'))

(/Users/sunfmin/gopkg/src/github.com/qor/qor/resource/curd.go:26) 
[2015-07-23 13:48:43]  Error 1406: Data too long for column 'cover_image' at row 1 

faceted search / searchkit integration

Hi guys,

Hope you are all well !

I am working now 2 weeks on qor and start to get the core principles of your framework :-) As I said earlier the setup process could be made more easier by pointing developers to a core stable release. But, I still think that in a couple of months it will be a robust e-commerce framework.

I was wondering these 2 quick and simple questions below about qor framework, hoping you, the qor team, will have some spare time to share your insights about them:

1. How to integrate a new pages or widgets with custom packages ?
For example, i'd like to add a search page with the searchkit package and get it nicely integrated to qor-example ? What would be the best pratices (knowing that i will use a docker compose for elasticsearch and another micro-service for importing data from the gorm model, and create a new endpoint for getting search results) ?

More simply, how/where to copy/paste the code for a frontend/backend integration in qor ?

2. vue.js bindings / gopherjs
How would it be possible to extend the admin ui with other boilerplates like the one mentioned below and get more advanced widgets for analytics or content browsing ?

More simply :-) how it is the more convenient to build an extendable admin rest api, exporting the orm schema, like ezorm, and to wrap more complex setup in qor

Thanks in advance for your reply and responses, meanwhile, have an awesome day ! :-)

Cheers,
Richard

qorJob.AddTableRow undefined

I just run "go run db/seeds/main.go" command, and following bug appear.
config/admin/worker.go:90: qorJob.AddTableRow undefined (type worker.QorJobInterface has no field or method AddTableRow)
config/admin/worker.go:93: qorJob.AddTableRow undefined (type worker.QorJobInterface has no field or method AddTableRow)

function "t" not defined

Hi

Commit "inline-edit: add translations for home page" (8495311) broke qor-example.

go version go1.6.2 linux/amd64, products pages show blank with following error:

Got error when render template product_show: template: application.tmpl:25: function "t" not defined
[GIN] 2016/04/25 - 11:31:55 | 200 |    8.014256ms | 10.211.55.2 |   GET     /products/blue-qor-watch_blue-light

products controller passes own funcMap to render.Render which does not have t defined.
home controller has "t" defined in i i18n funcs:

    i18nFuncMap := inline_edit.GenerateFuncMaps(i18n.I18n, "en-US", nil)
    config.View.Funcs(i18nFuncMap).Execute...

Latest qor-example requires at least golang v1.8

I was using golang v1.7.3 prior to upgrading to 1.8 because of the error:

# github.com/qor/admin
../go/src/github.com/qor/admin/route.go:92: undefined: sort.SliceStable

After upgrading to 1.8, the error is no longer there.

unit test未通过 执行go test -v ./...后出现

 # github.com/qor/qor-example/db/seeds

runtime.main: call to external function main.main

runtime.main: main.main: not defined

runtime.main: undefined: main.main
?       github.com/qor/qor-example  [no test files]
?       github.com/qor/qor-example/app/controllers  [no test files]
?       github.com/qor/qor-example/app/models   [no test files]
?       github.com/qor/qor-example/config   [no test files]
?       github.com/qor/qor-example/config/admin [no test files]
?       github.com/qor/qor-example/config/admin/bindatafs   [no test files]
?       github.com/qor/qor-example/config/api   [no test files]
?       github.com/qor/qor-example/config/auth  [no test files]
?       github.com/qor/qor-example/config/i18n  [no test files]
?       github.com/qor/qor-example/config/routes    [no test files]
?       github.com/qor/qor-example/db   [no test files]
?       github.com/qor/qor-example/db/migrations    [no test files]

http: panic serving [::1]:52761: reflect: Call using zero Value argument goroutine 37 [running]:

I'm trying to register a new user, then receive an email with a link but as soon as link like this one http://localhost:5001/auth/confirm?cnf=5hK8XjphhnRjvoDB9tfVrgho_e35aK8ggNARGbgOovE%3D is opened I'm getting an exception in console. I have put Printfs in ./config/auth/db_storer.go on lines 31 and 32:

fmt.Printf("user: %s", user)
fmt.Printf("attr: %s", attr)

Logs:

Listening on: 5001
user: {{%!s(uint=646) 2017-02-07 13:39:45 +0100 CET 2017-02-07 13:39:45 +0100 CET <nil>} [email protected] XXX { %!s(bool=false)}   [] b5oW3No0hOu0yEmLFPXXX== %!s(bool=false)  <nil>}attr: map[gender: confirm_token: confirmed:%!s(bool=true) addresses:[] recover_token: recover_token_expiry:<nil> model:{%!s(uint=646) 2017-02-07 13:39:45 +0100 CET 2017-02-07 13:39:45 +0100 CET <nil>} email:[email protected] password:XXX name:<nil> role:]http: panic serving [::1]:52761: reflect: Call using zero Value argument
goroutine 37 [running]:
net/http.(*conn).serve.func1(0xc42116e000)
	/usr/local/go/src/net/http/server.go:1491 +0x12a
panic(0x6c4fe0, 0xc420deb680)
	/usr/local/go/src/runtime/panic.go:458 +0x243
reflect.Value.call(0x6fe4e0, 0xc42034f720, 0x213, 0x7ac0e3, 0x4, 0xc4210494a8, 0x1, 0x1, 0xc4203542c0, 0x13, ...)
	/usr/local/go/src/reflect/value.go:366 +0x1172
reflect.Value.Call(0x6fe4e0, 0xc42034f720, 0x213, 0xc4210494a8, 0x1, 0x1, 0xc42034f720, 0x213, 0x7349c0)
	/usr/local/go/src/reflect/value.go:302 +0xa4
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.Attributes.Bind(0xc4211735c0, 0x700260, 0xc42034f6c0, 0x1, 0x1, 0x140)
	/Users/kirylkazlovich/development/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/storer.go:296 +0x720
github.com/qor/qor-example/config/auth.AuthStorer.Put(0xc421174d40, 0x19, 0xc4211735c0, 0x6c4fe0, 0xc421049780)
	/Users/kirylkazlovich/development/go/src/github.com/qor/qor-example/config/auth/db_storer.go:34 +0x2e2
github.com/qor/qor-example/config/auth.(*AuthStorer).Put(0xb2ebd8, 0xc421174d40, 0x19, 0xc4211735c0, 0xc420128501, 0xc421049701)
	<autogenerated>:2 +0x6a
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*Context).SaveUser(0xc4210e6200, 0x7ad6fa, 0x5)
	/Users/kirylkazlovich/development/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/context.go:109 +0xb3
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).confirmHandler(0xc4200deda0, 0xc4210e6200, 0xae7c80, 0xc420bc75f0, 0xc4210620f0, 0xae7600, 0xc421174180)
	/Users/kirylkazlovich/development/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:199 +0x601
github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.(*Confirm).(github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm.confirmHandler)-fm(0xc4210e6200, 0xae7c80, 0xc420bc75f0, 0xc4210620f0, 0xc4210e6200, 0xc420dea000)
	/Users/kirylkazlovich/development/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/confirm/confirm.go:86 +0x52
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.contextRoute.ServeHTTP(0xc420420780, 0xc420ad9be0, 0xae7c80, 0xc420bc75f0, 0xc4210620f0)
	/Users/kirylkazlovich/development/go/src/github.com/qor/qor-example/vendor/gopkg.in/authboss.v0/router.go:58 +0x113
github.com/qor/qor-example/vendor/gopkg.in/authboss%2ev0.(*contextRoute).ServeHTTP(0xc420ad9c90, 0xae7c80, 0xc420bc75f0, 0xc4210620f0)
	<autogenerated>:124 +0x79
net/http.(*ServeMux).ServeHTTP(0xc420ae08a0, 0xae7c80, 0xc420bc75f0, 0xc4210620f0)
	/usr/local/go/src/net/http/server.go:2022 +0x7f
net/http.(*ServeMux).ServeHTTP(0xc420ae0870, 0xae7c80, 0xc420bc75f0, 0xc4210620f0)
	/usr/local/go/src/net/http/server.go:2022 +0x7f
net/http.(*ServeMux).ServeHTTP(0xc420ae0780, 0xae7c80, 0xc420bc75f0, 0xc4210620f0)
	/usr/local/go/src/net/http/server.go:2022 +0x7f
github.com/gorilla/csrf.(*csrf).ServeHTTP(0xc420f6fcc0, 0xae7c80, 0xc420bc75f0, 0xc4210620f0)
	/Users/kirylkazlovich/development/go/src/github.com/gorilla/csrf/csrf.go:267 +0x3ba
main.main.func1.1(0xae7c80, 0xc420bc75f0, 0xc4200e2f00)
	/Users/kirylkazlovich/development/go/src/github.com/qor/qor-example/main.go:37 +0x78
net/http.HandlerFunc.ServeHTTP(0xc420a76d80, 0xae7c80, 0xc420bc75f0, 0xc4200e2f00)
	/usr/local/go/src/net/http/server.go:1726 +0x44
net/http.serverHandler.ServeHTTP(0xc420a8a500, 0xae7c80, 0xc420bc75f0, 0xc4200e2f00)
	/usr/local/go/src/net/http/server.go:2202 +0x7d
net/http.(*conn).serve(0xc42116e000, 0xae8600, 0xc42114a4c0)
	/usr/local/go/src/net/http/server.go:1579 +0x4b7
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2293 +0x44d

qor example doesn't build :: collect2: error: ld returned 1 exit status

Hi, I am facing an issue where I can't build the qor example. Can you guide me?

Errors:

[root@jesusrico TA]# export GOPATH=/media/matrix/TA/
[root@jesusrico TA]# go get -u github.com/qor/qor-example

github.com/fatih/color

src/github.com/fatih/color/color.go:9:31: error: import file ‘github.com/mattn/go-colorable’ not found
"github.com/mattn/go-colorable"
^
src/github.com/fatih/color/color.go:10:28: error: import file ‘github.com/mattn/go-isatty’ not found
"github.com/mattn/go-isatty"
^
src/github.com/fatih/color/color.go:17:16: error: reference to undefined name ‘isatty’
var NoColor = !isatty.IsTerminal(os.Stdout.Fd())
^
src/github.com/fatih/color/color.go:150:14: error: reference to undefined name ‘colorable’
var Output = colorable.NewColorableStdout()
^
[root@jesusrico TA]# go get -u github.com/mattn/go-colorable
[root@jesusrico TA]# go get -u github.com/mattn/go-isatty
[root@jesusrico TA]# go get -u github.com/qor/qor-example

github.com/qor/qor-example

/media/matrix/TA/pkg/gccgo_linux_amd64/github.com/fatih/libcolor.a(go.o): In function github_com_fatih_color..import': /media/matrix/TA/src/github.com/fatih/color/color.go:17: undefined reference togithub_com_mattn_go_isatty.IsTerminal'
/media/matrix/TA/src/github.com/fatih/color/color.go:150: undefined reference to `github_com_mattn_go_colorable.NewColorableStdout'
collect2: error: ld returned 1 exit status

[root@jesusrico TA]# go version
go version go1.6.1 gccgo (GCC) 6.1.1 20160501 linux/amd64

Loading in seed data

When I run main.go to load in the seed data I get the following error:

←[35m(z:/goworkspace/src/github.com/qor/qor-example/db/seeds/main.go:286)←[0m
←[33m[2015-10-15 20:41:13]←[0m ←[36;1m[0.00ms]←[0m SELECT * FROM size_variations WHERE (size_variations.deleted_at IS NULL OR size_variations.deleted_at <= '0001-01-02')

←[35m(z:/goworkspace/src/github.com/qor/qor-example/db/seeds/main.go:312)←[0m
←[33m[2015-10-15 20:41:13]←[0m ←[36;1m[3.04ms]←[0m INSERT INTO orders (shipping_address_id,billing_address_id,payment_amount,abandoned_reason,user_id,state,created_at,updated_at,d eleted_at,discount_value) VALUES ('1','1','0','','1','draft','2015-10-15T20:41:13+11:00','2015-10-15T20:41:13+11:00','','0')
panic: runtime error: integer divide by zero
[signal 0xc0000094 code=0x0 addr=0x0 pc=0x406416]

goroutine 1 [running]:
main.createOrders()
z:/goworkspace/src/github.com/qor/qor-example/db/seeds/main.go:316 +0x9e6
main.createRecords()
z:/goworkspace/src/github.com/qor/qor-example/db/seeds/main.go:74 +0x93c
main.main()
z:/goworkspace/src/github.com/qor/qor-example/db/seeds/main.go:47 +0x4e

goroutine 5 [chan receive]:
database/sql.(*DB).connectionOpener(0xc0821695e0)
c:/go/src/database/sql/sql.go:634 +0x4c
created by database/sql.Open
c:/go/src/database/sql/sql.go:481 +0x33d
exit status 2

I can access the site on port 7000..there isn't any sample data loaded in..
Your assistance would be much appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.