QOR is a set of libraries written in Go that abstracts common features needed for business applications, CMSs, and E-commerce systems.

Overview

QOR

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

中文聊天室: 加入中国Qor聊天室 https://gitter.im/qor/qor/china

Build Status

For security issues, please send us an email to [email protected] and give us time to respond BEFORE posting as an issue or reporting on public forums.

What is QOR?

QOR is a set of libraries written in Go that abstracts common features needed for business applications, CMSs, and E-commerce systems.

This is a complete rewrite in Go, of the original QOR, which was a proprietary framework written in Ruby on Rails and used internally at The Plant. QOR 1.0 is the first version to be open sourced and distributed under the MIT license.

What QOR is not

QOR is not a "boxed turnkey solution". You need proper coding skills to use it. It's designed to make the lives of developers easier when building complex EC systems, not providing you one out of the box.

Documentation

https://doc.getqor.com/

The modules

  • Admin - The core part of QOR system, will generate an admin interface and RESTFul API for you to manage your data

  • Publish - Providing a staging environment for all content changes to be reviewed before being published to the live system

  • Transition - A configurable State Machine: define states, events (eg. pay order), and validation constraints for state transitions

  • Media Library - Asset Management with support for several cloud storage backends and publishing via a CDN

  • Worker (Batch processing) - A process scheduler

  • Exchange - Data exchange with other business applications using CSV or Excel data

  • Internationalization (i18n) - Managing and (inline) editing of translations

  • Localization (l10n) - Manage DB-backed models on per-locale basis, with support for defining/editing localizable attributes, and locale-based querying

  • Roles - Access Control

  • And more https://github.com/qor

Live DEMO

Frontend Development

Requires Node.js and Gulp for building frontend files

npm install && npm install -g gulp
  • Watch SCSS/JavaScript changes: gulp
  • Build Release files: gulp release

License

Released under the MIT License.

Comments
  • No documentation comments

    No documentation comments

    To be a first class citizen in the Go ecosystem, all exported functions, methods and types should have appropriate documentation comments.

    http://golang.org/doc/effective_go.html#commentary

    No matter how good the documentation on the website is, the godoc is the most important thing. Please document this stuff!

    opened by rogpeppe 9
  • fix table creation for translations on mysql

    fix table creation for translations on mysql

    when using a database with DEFAULT CHARACTER SET utf8mb4 on mysql the table creation will fail when not limited in size for key,locale: the compound primary key would exceed the size limit: Error 1071: Specified key was too long; max key length is 767 bytes ideally we'd want to only limit the length to which the index uses the fields, but 190/20 should be sufficient for keys and locales.

    opened by fvbock 9
  • use Go module install dependency package, /admin request error

    use Go module install dependency package, /admin request error

    I use go.mod to install dependency package build successful, but an error occurred while requesting /admin

    if go get github/qor/... , everything is ok if install the package use 'go.mod', error occurred.

    2019/03/17 01:24:17 http: panic serving [::1]:50992: runtime error: invalid memory address or nil pointer dereference goroutine 67 [running]: net/http.(*conn).serve.func1(0xc00024e500) /usr/local/go/src/net/http/server.go:1769 +0x139 panic(0x4658c00, 0x4b7dc70) /usr/local/go/src/runtime/panic.go:522 +0x1b5 html/template.(*Template).escape(0x0, 0x0, 0x0) /usr/local/go/src/html/template/template.go:95 +0x2e html/template.(*Template).Execute(0x0, 0x47c8c40, 0xc0001b60e0, 0x46de140, 0xc00013e3f0, 0x1, 0xc0002327a0) /usr/local/go/src/html/template/template.go:119 +0x2f github.com/qor/admin.(*Context).Execute(0xc00013e3f0, 0x46e1a5e, 0x5, 0xc0001ae2c0, 0xc00000ed60) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/context.go:227 +0x22c github.com/qor/admin.(*Controller).Index.func1() /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/controller.go:37 +0x51 github.com/qor/responder.(*Responder).Respond(0xc0000d37c0, 0xc0001a6000) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/responder.go:77 +0x236 github.com/qor/admin.(*Controller).Index(0xc0002420b0, 0xc00013e3f0) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/controller.go:40 +0x297 github.com/qor/admin.(*Admin).NewServeMux.func2(0xc00013e3f0, 0xc00014fc20) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:176 +0x202 github.com/qor/admin.Middleware.Next(...) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:37 github.com/qor/admin.(*Admin).NewServeMux.func1(0xc00013e3f0, 0xc00014fbe0) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:166 +0x119 github.com/qor/admin.Middleware.Next(...) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:37 github.com/qor/admin.Admin.registerCompositePrimaryKeyCallback.func1(0xc00013e3f0, 0xc00014e3e0) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:27 +0x251 github.com/qor/admin.(*serveMux).ServeHTTP(0xc0004aa4d8, 0x47d2440, 0xc0001b60e0, 0xc0001a6000) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:267 +0x52c net/http.(*ServeMux).ServeHTTP(0xc0004acb80, 0x47d2440, 0xc0001b60e0, 0xc0001a6000) /usr/local/go/src/net/http/server.go:2375 +0x1d6 net/http.serverHandler.ServeHTTP(0xc0003ac750, 0x47d2440, 0xc0001b60e0, 0xc0001a6000) /usr/local/go/src/net/http/server.go:2774 +0xa8 net/http.(*conn).serve(0xc00024e500, 0x47d3640, 0xc00022e2c0) /usr/local/go/src/net/http/server.go:1878 +0x851 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:2884 +0x2f4 2019/03/17 01:25:17 Finish [GET] /admin/products Took 0.29ms 2019/03/17 01:25:17 http: panic serving [::1]:51017: runtime error: invalid memory address or nil pointer dereference goroutine 49 [running]: net/http.(*conn).serve.func1(0xc00014c320) /usr/local/go/src/net/http/server.go:1769 +0x139 panic(0x4658c00, 0x4b7dc70) /usr/local/go/src/runtime/panic.go:522 +0x1b5 html/template.(*Template).escape(0x0, 0x0, 0x0) /usr/local/go/src/html/template/template.go:95 +0x2e html/template.(*Template).Execute(0x0, 0x47c8c40, 0xc0001162a0, 0x46de140, 0xc000124b60, 0x1, 0xc0003b0660) /usr/local/go/src/html/template/template.go:119 +0x2f github.com/qor/admin.(*Context).Execute(0xc000124b60, 0x46e1a5e, 0x5, 0xc0001ae2c0, 0xc00014fd00) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/context.go:227 +0x22c github.com/qor/admin.(*Controller).Index.func1() /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/controller.go:37 +0x51 github.com/qor/responder.(*Responder).Respond(0xc0003557c0, 0xc00057c400) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/respond[email protected]/responder.go:77 +0x236 github.com/qor/admin.(*Controller).Index(0xc0002420b0, 0xc000124b60) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/controller.go:40 +0x297 github.com/qor/admin.(*Admin).NewServeMux.func2(0xc000124b60, 0xc00014fc20) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:176 +0x202 github.com/qor/admin.Middleware.Next(...) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:37 github.com/qor/admin.(*Admin).NewServeMux.func1(0xc000124b60, 0xc00014fbe0) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:166 +0x119 github.com/qor/admin.Middleware.Next(...) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:37 github.com/qor/admin.Admin.registerCompositePrimaryKeyCallback.func1(0xc000124b60, 0xc00014e3e0) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:27 +0x251 github.com/qor/admin.(*serveMux).ServeHTTP(0xc0004aa4d8, 0x47d2440, 0xc0001162a0, 0xc00057c400) /Users/zetachow/workspace/go/pkg/mod/github.com/qor/[email protected]/route.go:267 +0x52c net/http.(*ServeMux).ServeHTTP(0xc0004acb80, 0x47d2440, 0xc0001162a0, 0xc00057c400) /usr/local/go/src/net/http/server.go:2375 +0x1d6 net/http.serverHandler.ServeHTTP(0xc0003ac750, 0x47d2440, 0xc0001162a0, 0xc00057c400) /usr/local/go/src/net/http/server.go:2774 +0xa8 net/http.(*conn).serve(0xc00014c320, 0x47d3640, 0xc0001aea40) /usr/local/go/src/net/http/server.go:1878 +0x851 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:2884 +0x2f4

    opened by Frederic-Zhou 5
  • Issue with i18n function with database backend

    Issue with i18n function with database backend

    I create a repo which is a minimal reproducible code https://github.com/vincent178/qor_test/blob/master/main.go

    I don't know if I didn't use it correctly or it is a bug?

    Thanks, Vincent

    opened by vincent178 5
  • Latest version of QOR admin crashes

    Latest version of QOR admin crashes

    I ran "go get -u" to update my QOR app and found that QOR admin shows 404 error when I perform the deletion. Please check the attached screen

    screen shot 2017-10-31 at 6 08 57 pm
    opened by cheavck 4
  • slideout panel is broken in firefox

    slideout panel is broken in firefox

    opened by derlaft 4
  • Issue with pointer meta

    Issue with pointer meta

    type Link struct {
        gorm.Model
    }
    type SampleModel struct {
        gorm.Model
    
        GoodLinkID sql.NullInt64
        GoodLink Link
    
        BadLinkID sql.NullInt64
        BadLink *Link
    }
    

    When I add this sample model to QOR GoodLink works well, while BadLink throws this error in template:

    Get error when render template github.com/qor/qor/admin/views/metas/form/select_one.tmpl meta BadLink: reflect: call of reflect.Value.Interface on zero Value
    
    opened by derlaft 4
  • Rails-like validations

    Rails-like validations

    Hey folks! I came from Rails, and this is attempt to make Activerecord-like validations for Gorm. Work in progress, so I'll be very grateful for any ideas/suggestions.

    opened by josephbuchma 4
  • Need help for using qor in heroku

    Need help for using qor in heroku

    May be it's not issue related to qor.

    I set up a mini project qshop for learning qor.

    It worked fine locally(PORT (8080) and DATABASE_URL (postgres://username:[email protected]:5432/qshop) ENV variable must be set).

    After built successfully, the index page works, but "/admin" page failed in heroku deploy. (heroku-postgre used for database, database table AutoMigrate correctly)

    the error msgs are:

    
    Aug 01 17:55:37 qshop heroku/router:  at=error code=H13 desc="Connection closed without response" method=GET path="/admin" host=qshop.herokuapp.com request_id=aef1d2d7-16d6-47e6-909a-acd26ee0ccf3 fwd="118.186.147.12" dyno=web.1 connect=1ms service=2ms status=503 bytes=0 
    Aug 01 17:55:37 qshop app/web.1:  Start [GET] /admin 
    Aug 01 17:55:37 qshop app/web.1:  Finish [GET] /admin Took 0.29ms 
    Aug 01 17:55:37 qshop app/web.1:  http: panic serving 10.111.188.147:38894: runtime error: invalid memory address or nil pointer dereference 
    Aug 01 17:55:37 qshop app/web.1:  goroutine 9 [running]: 
    Aug 01 17:55:37 qshop app/web.1:  net/http.func·011() 
    Aug 01 17:55:37 qshop app/web.1:    /usr/local/go/src/net/http/server.go:1130 +0xbb 
    Aug 01 17:55:37 qshop app/web.1:  html/template.(*Template).escape(0xc208189d40, 0x0, 0x0) 
    Aug 01 17:55:37 qshop app/web.1:    /usr/local/go/src/html/template/template.go:59 +0xe4 
    Aug 01 17:55:37 qshop app/web.1:  html/template.(*Template).Execute(0xc208189d40, 0x7fa2aa9a2548, 0xc2080de1e0, 0x984da0, 0xc20817c300, 0x0, 0x0) 
    Aug 01 17:55:37 qshop app/web.1:    /usr/local/go/src/html/template/template.go:75 +0x3d 
    Aug 01 17:55:37 qshop app/web.1:  github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin.(*Context).Execute(0xc20817c300, 0x9c97f0, 0x9, 0x0, 0x0) 
    Aug 01 17:55:37 qshop app/web.1:    /tmp/build_16c7e847f933ac62773f9f4a88a3ac8a/xi3-qshop-6e506e2/.heroku/go/src/github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin/context.go:138 +0x536 
    Aug 01 17:55:37 qshop app/web.1:  github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin.(*controller).Dashboard(0xc20802c838, 0xc20817c300) 
    Aug 01 17:55:37 qshop app/web.1:    /tmp/build_16c7e847f933ac62773f9f4a88a3ac8a/xi3-qshop-6e506e2/.heroku/go/src/github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin/controller.go:45 +0x4f 
    Aug 01 17:55:37 qshop app/web.1:  github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin.*controller.Dashboard·fm(0xc20817c300) 
    Aug 01 17:55:37 qshop app/web.1:    /tmp/build_16c7e847f933ac62773f9f4a88a3ac8a/xi3-qshop-6e506e2/.heroku/go/src/github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin/route.go:79 +0x31 
    Aug 01 17:55:37 qshop app/web.1:  github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin.func·035(0xc20817c300, 0xc208180d00) 
    Aug 01 17:55:37 qshop app/web.1:    /tmp/build_16c7e847f933ac62773f9f4a88a3ac8a/xi3-qshop-6e506e2/.heroku/go/src/github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin/route.go:145 +0x5d7 
    Aug 01 17:55:37 qshop app/web.1:  github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin.(*Admin).ServeHTTP(0xc2080f25b0, 0x7fa2aa9a24e8, 0xc2080de1e0, 0xc208033d40) 
    Aug 01 17:55:37 qshop app/web.1:    /tmp/build_16c7e847f933ac62773f9f4a88a3ac8a/xi3-qshop-6e506e2/.heroku/go/src/github.com/xi3/qshop/Godeps/_workspace/src/github.com/qor/qor/admin/route.go:197 +0x541 
    Aug 01 17:55:37 qshop app/web.1:  net/http.(*ServeMux).ServeHTTP(0xc208189350, 0x7fa2aa9a24e8, 0xc2080de1e0, 0xc208033d40) 
    Aug 01 17:55:37 qshop app/web.1:    /usr/local/go/src/net/http/server.go:1541 +0x17d 
    Aug 01 17:55:37 qshop app/web.1:  net/http.serverHandler.ServeHTTP(0xc208194600, 0x7fa2aa9a24e8, 0xc2080de1e0, 0xc208033d40) 
    Aug 01 17:55:37 qshop app/web.1:    /usr/local/go/src/net/http/server.go:1703 +0x19a 
    Aug 01 17:55:37 qshop app/web.1:  net/http.(*conn).serve(0xc2080f1c20) 
    Aug 01 17:55:37 qshop app/web.1:    /usr/local/go/src/net/http/server.go:1204 +0xb57 
    Aug 01 17:55:37 qshop app/web.1:  created by net/http.(*Server).Serve 
    Aug 01 17:55:37 qshop app/web.1:    /usr/local/go/src/net/http/server.go:1751 +0x35e 
    
    

    Thanks.

    opened by txgo 4
  • fix string to int conversion issue for arguments

    fix string to int conversion issue for arguments

    had pq: invalid input syntax for integer: "%!d(MISSING)ude%!"(MISSING) don't search with strings on int fields use "%keyword%" only for string keywords

    opened by fvbock 4
  • Warning message

    Warning message "WARNING: AssetFS is used before overwrite it!"

    I tried to implement a router that allows requests to assets in public folder in my application. A warning message "WARNING: AssetFS is used before overwrite it!" always appears with debug stack trace when I run the app. However, the application runs just fine and the css files are loaded successfully by front-end. Could anyone please tell me what happens behind that message? The following is the init function of my routes package that uses bindatafs.

    package routes
    
    func init() {
    RootMux = http.NewServeMux()
    RootMux.Handle("/auth/", auth.Auth.NewServeMux())
    
    app.Admin.MountTo("/admin", RootMux)
    router := chi.NewRouter()
    router.Get("/", controllers.HomeIndex)
    
    //RootMux.Handle("/system/", utils.FileServer(http.Dir(filepath.Join(config.Root, "public"))))
    assetFS := bindatafs.AssetFS.FileServer(http.Dir("public"), "javascripts", "stylesheets", "images", "dist", "fonts", "vendors")
    for _, path := range []string{"javascripts", "stylesheets", "images", "dist", "fonts", "vendors"} {
    	RootMux.Handle(fmt.Sprintf("/%s/", path), assetFS)
    }
    
    WildcardRouter := wildcard_router.New()
    WildcardRouter.MountTo("/", RootMux)
    WildcardRouter.AddHandler(router)
    }
    
    opened by cheavck 3
  • Tested documenation example from go1.15-1.18, get nil pointer dereference

    Tested documenation example from go1.15-1.18, get nil pointer dereference

    Hello;

    When attempting to build the example in the documentation with latest version of the go compiler ( go 1.18 ):

    $ go run main.go
    2022/03/30 10:59:32 RegisterViewPathError: github.com/qor/admin/views not found!
    
    [2022-03-30 10:59:32] [info] registering callback `qor_admin:composite_primary_key` from /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:34
    
    [2022-03-30 10:59:32] [info] registering callback `qor_admin:composite_primary_key` from /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:39
    Listening on: 9000
    2022/03/30 10:59:38 Finish [GET] /admin Took 0.06ms
    2022/03/30 10:59:38 http: panic serving 127.0.0.1:59800: runtime error: invalid memory address or nil pointer dereference
    goroutine 20 [running]:
    net/http.(*conn).serve.func1()
            /usr/lib/go/src/net/http/server.go:1825 +0xbf
    panic({0x988a40, 0xd66080})
            /usr/lib/go/src/runtime/panic.go:844 +0x258
    html/template.(*Template).escape(0x0)
            /usr/lib/go/src/html/template/template.go:97 +0x34
    html/template.(*Template).Execute(0x0, {0xacd480, 0xc0002ea380}, {0x9ed260, 0xc00040f420})
            /usr/lib/go/src/html/template/template.go:121 +0x32
    github.com/qor/admin.(*Context).Execute(0xc00040f420, {0x9f66dd?, 0x0?}, {0x0?, 0x0})
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/context.go:227 +0x2d9
    github.com/qor/admin.(*Controller).Dashboard(0x969380?, 0xc0004378c0?)
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/controller.go:28 +0x2c
    github.com/qor/admin.(*Admin).NewServeMux.func2(0xc00040f420, 0x9d4480?)
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/route.go:197 +0x183
    github.com/qor/admin.Middleware.Next(...)
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/route.go:38
    github.com/qor/admin.(*Admin).NewServeMux.func1(0xc00040f420, 0xc0004401a0)
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/route.go:187 +0x1d3
    github.com/qor/admin.Middleware.Next(...)
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/route.go:38
    github.com/qor/admin.Admin.registerCompositePrimaryKeyCallback.func1(0xc00040f420, 0xc00032f760)
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:27 +0x1f1
    github.com/qor/admin.(*serveMux).ServeHTTP(0x7f8c659912e8?, {0xacf6c0?, 0xc0002ea380}, 0xc0001c5a00)
            /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/route.go:288 +0x94f
    net/http.(*ServeMux).ServeHTTP(0x0?, {0xacf6c0, 0xc0002ea380}, 0xc0001c5a00)
            /usr/lib/go/src/net/http/server.go:2462 +0x149
    net/http.serverHandler.ServeHTTP({0xc00042fe90?}, {0xacf6c0, 0xc0002ea380}, 0xc0001c5a00)
            /usr/lib/go/src/net/http/server.go:2916 +0x43b
    net/http.(*conn).serve(0xc00043e320, {0xacf948, 0xc00042fda0})
            /usr/lib/go/src/net/http/server.go:1966 +0x5d7
    created by net/http.(*Server).Serve
            /usr/lib/go/src/net/http/server.go:3071 +0x4db
    

    Same results tested back to go 1.16. However, Go 1.15 (Debian 11 from package) in a container works:

    $ go run main.go
    # github.com/mattn/go-sqlite3
    sqlite3-binding.c: In function ‘sqlite3SelectNew’:
    sqlite3-binding.c:129019:10: warning: function may return address of local variable [-Wreturn-local-addr]
    129019 |   return pNew;
           |          ^~~~
    sqlite3-binding.c:128979:10: note: declared here
    128979 |   Select standin;
           |          ^~~~~~~
    
    [2022-03-30 12:51:59] [info] registering callback `qor_admin:composite_primary_key` from /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:34
    
    [2022-03-30 12:51:59] [info] registering callback `qor_admin:composite_primary_key` from /home/dmitridb/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:39
    Listening on: 9000
    2022/03/30 12:52:22 Finish [GET] /admin Took 3.84ms
    

    Any insights on supporting the latest versions of golang before this falls out of Debian LTS?

    opened by dmitridb 1
  • github.com/qor/qor/resource/crud.go:64:27: scope.PrimaryField undefined (type *

    github.com/qor/qor/resource/crud.go:64:27: scope.PrimaryField undefined (type *"gorm.io/gorm".Statement has no field or method PrimaryField)

    github.com/qor/qor/resource/crud.go:64:27: scope.PrimaryField undefined (type *"gorm.io/gorm".Statement has no field or method PrimaryField)

    ??

    opened by soease 0
  • Setting belongs_to / many_to_many relationships broken if using bigint/uint64 as ids

    Setting belongs_to / many_to_many relationships broken if using bigint/uint64 as ids

    Hi,

    I believe thelatest merge into master broke saving/setting both belongs_to and many_to_many relationships if the underlying models use uint64 instead of uint to represent the id field for records.

    How I noticed this:

    • When trying to save a record with relationships in QOR admin, I got the error: Failed to set Meta [MY_RECORD]'s value with [262 279 ], got interface conversion: interface {} is uint64, not uint
    • I looked at the stack trace of the error: github.com/qor/qor/resource/meta.go:297 and saw that the line hitting the error is relatively new code and does the following logic:
    // if currentVersionName is blank, we consider it is creating a new version
    if recordValue.FieldByName("ID").Interface().(uint) != 0 && currentVersionName == "" {...
    

    I think the issue is that I store id fields as uint64 instead of uint. I changed my vendored code above to uint64 and everything appears to work.

    Can you also support uint64 ids in this != 0 check?

    Thanks! Let me know if you have any questions!

    opened by willvictor 7
  • Virtual field shows wrong value when a related column is hidden

    Virtual field shows wrong value when a related column is hidden

    Hello, am having some issues hiding a column that I use to calculate a virtual field. In summary if I hide the field then the virtual field shows a wrong value. This is the situation:

    I have a resource named Zoo that have many Animals, currently in the index view I can see all the animals that belongs to that Zoo. Now, I don't want to show the list and instead only show the number of animals, in order to do so I created a virtual field as next:

    myZoo := admin_app.AddResource(&Zoo{}, &admin.Config{Menu: []string{"Zoos"}})
    myZoo.Meta(&admin.Meta{
    		Name: "AnimalsCount",
    		Type:"text",
    		Valuer: func(record interface{}, context *qor.Context) interface{} {
    			z := record.(*Zoo)
    			return strconv.Itoa(len(z.Animals))
    		},
    		Setter: func(record interface{}, metaValue *resource.MetaValue, context *qor.Context) {
    		},
    		FormattedValuer: func(record interface{}, context *qor.Context) (result interface{}) {
    			z := record.(*Zoo)
    			return strconv.Itoa(len(z.Animals))
    		},
    })
    myZoo.IndexAttrs(myZoo.IndexAttrs(),"AnimalsCount")
    

    At this point everything goes well and the count displayed is correct. Now, when I hide the Animals column the count goes everytime to zero:

    myZoo.ShowAttrs("-Animals")

    Is there any workaround to this issue?

    opened by sredxny 3
Releases(v1.3.0)
Ozair Farahi 11 Nov 15, 2022
An opinionated productive web framework that helps scaling business easier.

appy An opinionated productive web framework that helps scaling business easier, i.e. focus on monolith first, only move to microservices with GRPC la

appist 128 Nov 4, 2022
Hexya business application development framework

Hexya Hexya is an open source ERP and a business application development framework written in Go. This repository houses the business application deve

Hexya 362 Jan 5, 2023
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance. Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。

Tigo(For English Documentation Click Here) 一个使用Go语言开发的web框架。 相关工具及插件 tiger tiger是一个专门为Tigo框架量身定做的脚手架工具,可以使用tiger新建Tigo项目或者执行其他操作。

Karl 1.4k Jan 5, 2023
Kubewrap - kubewrap is an kubernetes command line utility with a focus to explore the kubernetes REST API's leveraging the go libraries available along with golang and cobra packages.

Kubewrap kubewrap is an kubernetes cli wrapper with a focus to explore the kubernetes REST API's leveraging the go libraries available along with gola

Daniel Pickens 1 Nov 20, 2022
REST API made using native Golang libraries. This API resembles the basic working of Instagram.

Golang RESTful API for Instagram A Go based REST API built using native libraries. The API has been thoroughly worked through with Postman. Routes inc

Bhavya Goel 1 Mar 16, 2022
Httpserver go - Server using only the go's libraries

API Rest Server This server use only the standard library of go (http, fmt and j

Andres Alvarez 0 Jun 21, 2022
Boilerplate API template includes all the common packages and setup used for API development in this Company

Boilerplate API Boilerplate API template includes all the common packages and setup used for API development in this Company. Development Copy .env.ex

null 11 Feb 19, 2022
Verifying concurrent crash-safe systems

Verifying concurrent, crash-safe systems with Perennial Perennial is a system for verifying correctness for systems with both concurrency and crash-sa

MIT PDOS 96 Dec 30, 2022
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework Flamingo is a web framework based on Go. It is designed to build pluggable and maintainable web projects. It is production ready, f

Flamingo 343 Jan 5, 2023
Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

golanger 298 Nov 14, 2022
re:Web enables classic web applications to run on AWS Lambda.

re:Web re:Web enables classic web applications to run on AWS Lambda. re:Web interfaces with the Lambda Runtime API. It translates API Gateway requests

null 106 Jan 1, 2023
An app skeleton for very simple golang web applications

Golang App Skeleton This is a skeleton for a golang web application optimized for simplicity and rapid development. Prerequisites Go 1.15 or greater O

Ad Hoc 76 Oct 16, 2022
Pulp allows you to write dynamic web-applications entirely in go

pulp Pulp allows you to write dynamic web-applications entirely in go, by reacting to events on the server-side. func (c index) Render(pulp.Socket) (p

malte.l 18 Dec 5, 2022
Gopify is a simple package for developing Shopify applications in Go.

Gopify Gopify is a simple package for developing Shopify applications in Go. Table of Contents Usage Oauth Start oauth process Oauth callback API call

oussama 16 Dec 30, 2022
REST api using fiber framework written in golang and using firebase ecosystem to authentication, storage and firestore as a db and use clean architecture as base

Backend API Example FiberGo Framework Docs : https://github.com/gofiber Info This application using firebase ecosystem Firebase Auth Cloud Storage Fir

Atilla Pehlivan 3 May 31, 2022
Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.

Ponzu Watch the video introduction Ponzu is a powerful and efficient open-source HTTP server framework and CMS. It provides automatic, free, and secur

Ponzu 5.5k Dec 28, 2022
Muxie is a modern, fast and light HTTP multiplexer for Go. Fully compatible with the http.Handler interface. Written for everyone.

Muxie ?? ?? ?? ?? ?? ?? Fast trie implementation designed from scratch specifically for HTTP A small and light router for creating sturdy backend Go a

Gerasimos (Makis) Maropoulos 280 Dec 8, 2022
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.

go-zero English | 简体中文 0. what is go-zero go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the

好未来技术 22.1k Jan 2, 2023