Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Minh Nguyen
@ntminh611
can anyone show me the way to setup qor-example with sql-lite?
Ayo Adesokan
@adesokanayo_twitter
I want to upgrade an existing Qor project in production . It currently uses v 1.0 . Is there any guide I can follow , or any tips.
Minh Nguyen
@ntminh611
image.png
Why It return this error when did with this tutorial: https://doc.getqor.com/get_started.html -> error:
Ayo Adesokan
@adesokanayo_twitter
Did you configure your database ?
Minh Nguyen
@ntminh611
I used sqlite3 like tutorial: https://doc.getqor.com/get_started.html, does it need to config?
Ayo Adesokan
@adesokanayo_twitter
I think you will need to have sql lite installed , could you check sqlite is installed on your machine.
Minh Nguyen
@ntminh611
I think sql lite not need install, because if need install, it will be sql not lite, :D
Ayo Adesokan
@adesokanayo_twitter
I have a Qor instance on heroku . I upgraded it and everything looks fine locally, but on heroku , the /admin doesnt work and panic as in the error below.
Finish [GET] /admin Took 14.38ms
2021-03-08T01:42:21.479391+00:00 app[web.1]: 2021/03/08 01:42:21 http: panic serving 10.150.246.196:31987: runtime error: invalid memory address or nil pointer dereference
2021-03-08T01:42:21.479393+00:00 app[web.1]: goroutine 30 [running]:
2021-03-08T01:42:21.479394+00:00 app[web.1]: net/http.(*conn).serve.func1(0xc00031cb40)
2021-03-08T01:42:21.479396+00:00 app[web.1]: /tmp/codon/tmp/cache/go1.15.5/go/src/net/http/server.go:1801 +0x147
2021-03-08T01:42:21.479396+00:00 app[web.1]: panic(0xd38f40, 0x1416bf0)
2021-03-08T01:42:21.479397+00:00 app[web.1]: /tmp/codon/tmp/cache/go1.15.5/go/src/runtime/panic.go:975 +0x47a
2021-03-08T01:42:21.479397+00:00 app[web.1]: html/template.(*Template).escape(0x0, 0x0, 0x0)
2021-03-08T01:42:21.479398+00:00 app[web.1]: /tmp/codon/tmp/cache/go1.15.5/go/src/html/template/template.go:95 +0x3b
2021-03-08T01:42:21.479399+00:00 app[web.1]: html/template.(*Template).Execute(0x0, 0xf73d60, 0xc00092a000, 0xe1d9e0, 0xc0001a75e0, 0x1, 0xc00028c700)
2021-03-08T01:42:21.479399+00:00 app[web.1]: /tmp/codon/tmp/cache/go1.15.5/go/src/html/template/template.go:119 +0x2f
2021-03-08T01:42:21.479400+00:00 app[web.1]: github.com/qor/admin.(*Context).Execute(0xc0001a75e0, 0xe2afb9, 0x9, 0x0, 0x0)
2021-03-08T01:42:21.479400+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/context.go:227 +0x225
2021-03-08T01:42:21.479401+00:00 app[web.1]: github.com/qor/admin.(*Controller).Dashboard(...)
2021-03-08T01:42:21.479402+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/controller.go:28
2021-03-08T01:42:21.479402+00:00 app[web.1]: github.com/qor/admin.(*Admin).NewServeMux.func2(0xc0001a75e0, 0xc000568d80)
2021-03-08T01:42:21.479402+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/route.go:176 +0x1ea
2021-03-08T01:42:21.479403+00:00 app[web.1]: github.com/qor/admin.Middleware.Next(...)
2021-03-08T01:42:21.479403+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/route.go:37
2021-03-08T01:42:21.479404+00:00 app[web.1]: github.com/qor/admin.(*Admin).NewServeMux.func1(0xc0001a75e0, 0xc000568d40)
2021-03-08T01:42:21.479404+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/route.go:166 +0x117
2021-03-08T01:42:21.479405+00:00 app[web.1]: github.com/qor/admin.Middleware.Next(...)
2021-03-08T01:42:21.479405+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/route.go:37
2021-03-08T01:42:21.479406+00:00 app[web.1]: github.com/qor/l10n.(*Locale).ConfigureQorResource.func7(0xc0001a75e0, 0xc00086f300)
2021-03-08T01:42:21.479407+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/l10n@v0.0.0-20181031091737-2ca95fb3b4dd/l10n.go:248 +0x727
2021-03-08T01:42:21.479407+00:00 app[web.1]: github.com/qor/admin.Middleware.Next(...)
2021-03-08T01:42:21.479408+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/route.go:37
2021-03-08T01:42:21.479408+00:00 app[web.1]: github.com/qor/admin.Admin.registerCompositePrimaryKeyCallback.func1(0xc0001a75e0, 0xc00083eae0)
2021-03-08T01:42:21.479409+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/composite_primary_key_callback.go:27 +0x25c
2021-03-08T01:42:21.479410+00:00 app[web.1]: github.com/qor/admin.(*serveMux).ServeHTTP(0xc00058efe0, 0xf822e0, 0xc00092a000, 0xc000554300)
2021-03-08T01:42:21.479410+00:00 app[web.1]: /tmp/codon/tmp/cache/go-path/pkg/mod/github.com/qor/admin@v0.0.0-20200908023436-0c0a0b041c88/route.go:267 +0x54e
2021-03-08T01:42:21.479411+00:00 app[web.1]: net/http.(*ServeMux).ServeHTTP(0xc000033680, 0x
Utku Çağlayan
@utku-caglayan

Hi everyone! I have been trying to add a filter to a resource as:

    kw := r.admin.AddResource(kw_dictionary.KWDictionary{}, &admin.Config{
        Menu: []string{r.menu.KWDictionaryManagement},
    })

       kw.Filter(&admin.Filter{
        Name: "CreatedAt",
        Config: &admin.DatetimeConfig{
            ShowTime: true,
        },
    })

with model being:

type KWDictionary struct {
    gorm.Model

    Query    string `gorm:"not null"`
    ActionID uint
    Username string
}

gorm.Model contains the "CreatedAt" field as you know. Sadly it does not show on UI. Have you ever experienced this?

Utku Çağlayan
@utku-caglayan
It worked out thanks anyway
Ayo Adesokan
@adesokanayo_twitter
Sounds good. just FYI, I got the heroku issues where admin wasnt loading resolved as well.
Filip Dimitrovski
@filipArena
Is this lib maintained? I see last release is released in 2019
Also the demo app link doesn't work
Aleksandr
@AleksandrMac

Hello everyone. I started learning QOR and ran into a popular problem. (windows10 go1.16.3)

2021.04.16 15:47:28 End [GET] / admin Took 3.00ms
2021/04/16 15:47:28 http: panic serve [:: 1]: 1541: runtime error: invalid memory address or null pointer dereference
goroutine 162 [works]:
network / http. (* conn) .serve.func1 (0xc00017e640)
        C: / Program Files / Go / src / net / http / server.go: 1824 + 0x153
panic (0x6b9b20, 0xa91020)
        C: / Program Files / Go / src / runtime / panic.go: 971 + 0x49a
html / template. (* Template) .escape (0x0, 0x0, 0x0)
        C: / Program Files / Go / src / html / template / template.go: 97 + 0x42
html / template. (* Template) .Execute (0x0, 0x803600, 0xc0002b80e0, 0x731e80, 0xc00017c770, 0x1, 0xc0000184b0)
        C: / Program Files / Go / src / html / template / template.go: 121 + 0x36
github.com/qor/admin.(*Context).Execute(0xc00017c770, 0x73af31, 0x9, 0x0, 0x0)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/context.go: 229 + 0x22c
github.com/qor/admin. (* Controller). Control Panel (...)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/controller.go: 28
github.com/qor/admin.(*Admin).NewServeMux.func2(0xc00017c770,0xc0001a7480)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/route.go: 197 + 0x1f2
github.com/qor/admin.Middleware.Next (...)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/route.go: 38
github.com/qor/admin.(*Admin).NewServeMux.func1(0xc00017c770,0xc0001a7460)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/route.go: 187 + 0x122
github.com/qor/admin.Middleware.Next (...)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/route.go: 38
github.com/qor/admin.Admin.registerCompositePrimaryKeyCallback.func1(0xc00017c770,0xc0001a6600)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/composite_primary_key_callback.go: 27 + 0x25d
github.com/qor/admin.(*serveMux).ServeHTTP(0xc000007818, 0x80a6b0, 0xc0002b80e0, 0xc0005b2700)
        C: /Users/ALEXANDR/go/pkg/mod/github.com/qor/admin@v0.0.0-20210414090151-e54abcf1b0ac/route.go: 288 + 0x55a
net / http. (* ServeMux) .ServeHTTP (0xc000035200, 0x80a6b0, 0xc0002b80e0, 0xc0005b2700)
        C: / Program Files / Go / src / net / http / server.go: 2448 + 0x1b7
net / http.serverHandler.ServeHTTP (0xc0003a6000, 0x80a6b0, 0xc0002b80e0, 0xc0005b2700)
        C: / Program Files / Go / src / net / http / server.go: 2887 + 0xaa
network / http. (* conn) .serve (0xc00017e640, 0x80c1c0, 0xc000034740)
        C: / Program Files / Go / src / net / http / server.go: 1952 + 0x8cd
net / http is created. (* Server) .Serve
        C: / Program Files / Go / src / net / http / server.go: 3013 + 0x3b8

the problem is that or cannot find * .tmpl files.

I solved it in the following way:

  1. changed the line of code in the function in the file https://github.com/qor/admin/admin.go with

     func (admin * Admin) SetAssetFS (assetFS assetfs.Interface) {
         admin.AssetFS = assetFS
         globalAssetFSes = append (globalAssetFSes, assetFS)
    
         admin.AssetFS.RegisterPath (filepath.Join (utils.AppRoot, "app/views/qor"))
         admin.RegisterViewPath ("github.com/qor/admin/views")
    
         for _, viewPath: = range globalViewPaths {
             admin.RegisterViewPath (viewPath)
         }
     }

    the line
    admin.AssetFS.RegisterPath (filepath.Join (utils.AppRoot, "app/views/qor"))

    was replaced by the line
    admin.AssetFS.RegisterPath (filepath.Join (utils.AppRoot, "app/views/qor/admin"))

  2. created the directory "app/views/qor/admin" in the application directory

  3. put the files with the "admin" module templates into it

sorry for my english :)
translated with google

loveyandex
@loveyandex
hi
Sredny M.
@sredxny

Hello everyone! 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")

I already tried the workaround proposed in the issue qor/qor#258 but still doesn't work.

I just want show the count, not the list.
Read the Codes
@readthecodes
Qor Example still broken!!! can anyone help? qor/qor-example#181
Dimas Yudha P.
@dhiemaz
Hi , can qor admin use more than 1 db ?
tuan nguyen
@tuan6956_twitter
Hi every one, how to customize render select_one when orther select_one onChange
soease
@soease
图片.png
Keep spinning, no content.
Can anyone tell me why this is
Ercument ESER
@ercu
On my fork, I have added support for "pointer to custom structs" on db models so they can be edited on admin panel. could anyone comment on it? is it only me who needed this? ercu/admin@f3bb66a
Deividas Pekūnas
@Clasyc

Hey all, I'm getting an error in the bulk action header:

template: :11:18: executing "url$htmltemplate_stateURL_delimDoubleQuote_attrURL" at : error calling url_for: reflect: call of reflect.Value.Interface on zero Value

anyone had this problem?

It happens only if my struct uses l10n.Locale

for example:

type Product struct {
    gorm.Model
    Name        string
    Description string
    l10n.Locale
}
Deividas Pekūnas
@Clasyc
Does anyone experienced performance issues? It takes long time to list items in the table, DB is fine.
magnox2
@magnox2
Hello. Someone started a multivendor maketplace project with QOR?
soease
@soease
Has anyone researched how to use the latest gorm
Juan Granja
@juanxhoO

Hi, anyone knowns how to solve this issue? (i am using the code from Getting Started in QOR page)

2022/03/24 10:01:16 RegisterViewPathError: github.com/qor/admin/views not found!

[2022-03-24 10:01:16] [info] registering callback qor_admin:composite_primary_key from /home/juan/go/pkg/mod/github.com/qor/admin@v1.2.0/composite_primary_key_callback.go:34

[2022-03-24 10:01:16] [info] registering callback qor_admin:composite_primary_key from /home/juan/go/pkg/mod/github.com/qor/admin@v1.2.0/composite_primary_key_callback.go:39
Listening on: 9000

Thanks in advance!

dmitridb
@dmitridb
@juanxhoO qor/admin#266
I put in an issue
I was able to make it run using golang 1.15 from packages that I'm hoping will have the security fixes backported from 1.18
1.16-1.18 don't build
that's on debian btw
my usual development on go i'm using latest golang installed manually so in this case I spun up a container and did that and I was able to make the example work... I'm assuming that's how the people actually using this in production are doing things too somehow, assuming this project is being actively maintained (last commit last year so its hard to say, maybe a developer could chime in)
2 replies
i'd like to see how feasible this is for building an auction platform on top of
dmitridb
@dmitridb
I realize now I should have opened that issue on github.com/qor/qor
apologies for duplicating the issue across repos but if I'm going to go ahead with using this I'd love to know if more recent compilers will be supported going forward before starting off
dmitridb
@dmitridb
while I was able to get the example for getting started working on go 1.15 I wasn't able to get the authentication tutorial going. same issue, nil pointer, this time on line 28 of the example here https://doc.getqor.com/guides/authentication.html
dmitridb
@dmitridb
Seems issue may be related to latest gorm v2 https://github.com/go-gorm/gorm
soease
@soease
Hasn't this framework been updated?
Kevin Julian
@kevinjulian
hi ! may i know how to export/import from qor admin ?
i found https://github.com/qor/exchange but still don't know how to use that in admin page
Alex Thotse
@alexthotse
Hey guys
soease
@soease
no body...no body...
Keon Ye
@keonjeo
111
soease
@soease
hi