Git Product home page Git Product logo

qor's Introduction

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.

qor's People

Contributors

anatole avatar azumads avatar bigpigeon avatar binku87 avatar bodhi avatar bom-d-van avatar chenxin0723 avatar cryptix avatar cxjava avatar dependabot[bot] avatar ethanfrey avatar fvbock avatar gitter-badger avatar grengojbo avatar jasonweng avatar jinzhu avatar joelchen avatar junhuif avatar lancee avatar raven-chen avatar sg3des avatar stuartloxton avatar sunfmin avatar txgo avatar wtser avatar xuxinx 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qor's Issues

Error admin context

/Users/jbo/go/src/github.com/qor/qor/admin/context.go:137
template: publish_drafts.tmpl:20: function "rt" not defined
/Users/jbo/go/src/github.com/qor/qor/utils/utils.go:193 (0x2b6cb7)
ExitWithMsg: debug.PrintStack()
........

Authentication

What is the prospect or plan for authentication with regards to qor? Is proper authentication going to be added to this project prior to it reaching a released state?

Can not set address in some places in Vietnam

When I drag the marker location on Vietnam, there are some places I can not Set Address, and console logs show this error:
Uncaught TypeError: Cannot read property 'replace' of undefined location.js?theme=location:206

Default Locale option

It seems that qor didn't have locale options, but hard-coded in l10n.go and i18n
Could you support this option?

logging

It looks like there is no logging in the code.

From a brief look all i can see if StDOut logs statements.
For me, no logging is suicide to use this library. You have to know what your systems are doing, and if they are having issues.

Logrus is often used. There are other too, but so far Logrus is a good one that has gotten me far.

Is there an thoughts, advice, roadmap etc on this.

Password field problem

Hello,

When I edit the password field in admin I see plain user password and this password will be save in database. Please see attach.

screenshot from 2016-08-16 17 58 34

Best Regards,
Dmitry

Publish relationship empty rows in Postgres

In the qor-example when publish a book, https://github.com/qor/qor-example#publish---edit-first-then-push-to-production-db

While using postgres database It returns empty rows here
https://github.com/qor/qor/blob/master/publish/resolver.go#L201

But it woks fine in mysql

And it will panic:

(/Users/leicao/programming/go/src/github.com/qor/qor/publish/resolver.go:201)
[2015-08-02 17:38:38]  [1.63ms]  SELECT * FROM book_authors_draft
17:38:38 app         | Finish [POST] /admin/publishes Took 79.52ms
17:38:38 app         | http: panic serving [::1]:61560: runtime error: invalid memory address or nil pointer dereference
goroutine 230 [running]:
net/http.func·011()
    /usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1130 +0xbb
database/sql.(*Rows).Columns(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.4.2/libexec/src/database/sql/sql.go:1613 +0x5e
github.com/qor/qor/publish.(*resolver).Publish(0xc20824b5f0, 0x0, 0x0)
    /Users/leicao/programming/go/src/github.com/qor/qor/publish/resolver.go:202 +0x210b
github.com/qor/qor/publish.Publish.Publish(0xc2082c0320, 0xc208269900, 0x1, 0x1)
    /Users/leicao/programming/go/src/github.com/qor/qor/publish/publish.go:154 +0x54
github.com/qor/qor/publish.(*publishController).PublishOrDiscard(0xc20804c0c8, 0xc20820e2a0)
    /Users/leicao/programming/go/src/github.com/qor/qor/publish/controller.go:80 +0xb96
github.com/qor/qor/publish.*publishController.PublishOrDiscard·fm(0xc20820e2a0)
    /Users/leicao/programming/go/src/github.com/qor/qor/publish/controller.go:102 +0x31
github.com/qor/qor/admin.func·035(0xc20820e2a0, 0xc2081ab440)
    /Users/leicao/programming/go/src/github.com/qor/qor/admin/route.go:145 +0x5d7
github.com/qor/qor/admin.Middleware.Next(0x7e9d20, 0xc2081ab440, 0xc20820e2a0)
    /Users/leicao/programming/go/src/github.com/qor/qor/admin/route.go:47 +0x3c
github.com/qor/qor/l10n.func·005(0xc20820e2a0, 0xc2081aae90)
    /Users/leicao/programming/go/src/github.com/qor/qor/l10n/l10n.go:195 +0x10a
github.com/qor/qor/admin.(*Admin).ServeHTTP(0xc20805d5e0, 0xad5e38, 0xc2082e03c0, 0xc2082fc000)
    /Users/leicao/programming/go/src/github.com/qor/qor/admin/route.go:197 +0x541
net/http.(*ServeMux).ServeHTTP(0xc2081580c0, 0xad5e38, 0xc2082e03c0, 0xc2082fc000)
    /usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1541 +0x17d
net/http.serverHandler.ServeHTTP(0xc20808ed20, 0xad5e38, 0xc2082e03c0, 0xc2082fc000)
    /usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1703 +0x19a
net/http.(*conn).serve(0xc2082e0000)
    /usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1204 +0xb57
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1751 +0x35e
17:38:38 app         | Start [POST] /admin/publishes
17:38:38 app         |

Integration with Beego

Hi

I have exactly what ever explained in the FAQ to integrate admin with beego but I get 404.
Also I can run qor-example correctly...
What should I do?
2015/09/21 14:34:59 [router.go:854] [D] | GET | /admin | 424.265µs | notmatch |

Be able to sorting selected options in multiple selector

Support sorting selected options in multiple selector

Status overview

Qor2 multiple selector component

image

As the screenshot shows, the selected option has a sort icon, we drag the icon to sort the selected options.

Qor3 multiple selector component

image

The above screenshot shows the current multiple selector component. It doesn't support sorting selected options yet.

Feature requirement

Improve current multiple selector component in Qor3 to support sorting selected option like Qor2 provided.

Support editing datetime

In the admin, a time.Time field uses a date selector as the editor, there's no way to edit the time portion of the field.

undefined: admin.AssetManager?

I fork the open source that it uses admin.AssetManager, admin.go have AssetManager ago? Now, what do I use to replace it? Thx.

list add action

现在有两个Action 一个是删除 一个是编辑 我想加另一个, 怎么办

Can QOR be used for multi sellers ecommerce sites?

Can QOR be used for ecommerce sites like amazon.com or aliexpress.com? Where multiple sellers can signup and sell their products, while also managing their products from a dashboard. I cant see such support on the admin dashboard

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:password@localhost: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.

Failed to create unique index in publish

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

Question about dB.

What's the preferred dB to use ?
Postresql or mysql.
I just noticed that the example your working on uses mysql.

Also I believe your using an ORM. Are there any blockers to switching databases on my side ? Just want to check because I am thinking about trying out cockroachdb, which uses the same binary api as postresql.

Thanks in advance

problem with Nested Resource and router

Hallo, I have a problem with Qor nested resource. When a set the Rosouce for nested, some urls are unregistred. Let me explain:
I have two models:

type Order struct {
gorm.Model

   value float32

    Plans        []Plan
transition.Transition

}

And the model

type Plan struct {
gorm.Model
Name string
Tipe string
}
I created menu setup:

plans := Adm.AddResource(&Plan{}, &admin.Config{Menu: []string{"Plans"}})

    order:=Adm.AddResource(&Order{}, &admin.Config{Menu: []string{"Order"}})
order.Meta(&admin.Meta{Name: "Plans", Type:"collection_edit", Resource: plans})

The app is compiled without errors and the Plans form is nested in Order form, as wished, however the url /admin/plans gives 404 error code.
When I register without nested, the url works property:

plans := Adm.AddResource(&Plan{}, &admin.Config{Menu: []string{"Plans"}})

    order:=Adm.AddResource(&Order{}, &admin.Config{Menu: []string{"Order"}})

.
How should i solve this issue?
Thank you!

Be able to configure resource show page actions to popup the action input form

Right now we can config actions for any resources in Qor. But the action has limitation, It can not accept user input that are necessary for the action.

I suggest we can config additional form meta for an action, and automatically show up a form when user click the action. After user filled in the popup form, click Save, It will call that action custom code to do saving to database.

snip20150825_34

貌似发现一个错误

Admin.AddResource(&models.ContactUs{}, &admin.Config{Singleton: true})
&admin.Config{Singleton: true}这个配置使这个资源成为单条
但当数据库一条记录都没有的时候,就会产生一个404错误

After Validation

I'm trying to upload a zip file then extract its content to a directory. I'm unable to find a way to do so. Tried in validation but unable to get its path using "media_library.FileSystem".

Increase speed for open any page.

Open page in the qor-example 500-900ms on the local machine...
Why pages load so slow?
Slow templates?
GORM must work fast.
Maybe you must use pongo2 templates - fast, powerful, beautiful?

Search match or select with popup table list field

Feature 1: Select

The field will show default like this:

snip20150825_20

It's a text input field, with a select button icon. After you click select icon, It will show a popup page like this:

snip20150825_21

Select a row from the table it will fill text input field with text and a hidden ID I guess.

snip20150825_23

Feature 2: Input and It match automatically

You don't click select icon. But only input the search key words into the text field

snip20150825_24

After you click save the whole form button, It will automatically connect to the first record by using the text field input text to search

snip20150825_25

Be able to configure resource show page with Inline Edit

Right now, Qor3 can not configure a show page. But I think a show page is necessary for any center data types in any system.

I think we should be able to config a show page with Inline Edit feature for it's main data type's attributes

Zoho example:

snip20150825_29

Salesforce example:

snip20150825_30

After click it:

snip20150825_31

I personally think salesforce's is better.

Translation templates wrong somehow


2015/08/20 03:34:48.048150 route.go:178: Start [GET] /admin/translations
template: table.tmpl:15:25: executing "table.tmpl" at <.Result>: range can't iterate over {  [0xc8204b0018] map[en-US:map[qor_admin.customer_device_outcomings.attributes.客户名:0xc820013840 qor_admin.qor_admin.consumable_ins.Warehouse Name:0xc820656100 qor_admin.qor_admin.client_device_outs.By Whom:0xc820656480 qor_admin.client_device_ins.attributes.仓库:0xc820122040 qor_admin.qor_admin.devices.Edit Device:0xc8201a4880 qor_admin.qor_admin.client_device_ins.存入仓库:0xc820122540 qor_admin.qor_admin.device_outs.Edit DeviceOut:0xc8201a4940 qor_admin.device_ins.attributes.Date:0xc8201a50c0 qor_admin.consumable_outs.attributes.To Whom ID:0xc8201a5a40 qor_admin.Devices:0xc820012ec0 qor_admin.查询:0xc820013000 qor_admin.qor_admin.consumable_ins.Quantity:0xc8206560c0 qor_admin.Employees:0xc820013100 qor_admin.数据维护:0xc820013980 qor_admin.qor_admin.device_outs.Device Name:0xc8201a4a40 qor_admin.consumables.attributes.设备数量:0xc820013c80 qor_admin.qor_admin.report_items.Device Name:0xc820122c00 qor_admin.consumables.attributes.设备代码:0xc820013c40 qor_admin.client_device_ins.attributes.存入仓库:0xc820122340 qor_admin.qor_admin.report_items.Count:0xc820122d00 qor_admin.consumable_ins.attributes.By Whom Name:0xc8201a5e40 qor_admin.Cancel Edit:0xc820013480 qor_admin.customer_device_outcomings.attributes.仓库:0xc820013b00 qor_admin.qor_admin.client_device_outs.Quantity:0xc8206563c0 qor_admin.Dashboard:0xc820013500 qor_admin.qor_admin.devices.Devices:0xc8201233c0 qor_admin.client_device_ins.attributes.Quantity:0xc820122080 qor_admin.收入客户名不能为空:0xc820122a00 qor_admin.qor_admin.report_items.Client Name:0xc820122bc0 qor_admin.Logged in as {{$1}}:0xc820122f80 qor_admin.qor_admin.warehouses.Address:0xc820656700 qor_admin.设备管理:0xc820012e80 qor_admin.report_items.attributes.Client Name:0xc820013a40 qor_admin.logo:0xc820122fc0 qor_admin.client_device_outs.attributes.Warehouse Name:0xc820123300 qor_admin.qor_admin.consumable_ins.ConsumableIns:0xc8201a5d00 qor_admin.Translations:0xc8200131c0 qor_admin.report_items.attributes.Count:0xc8200136c0 qor_admin.qor_admin.client_device_outs.Add ClientDeviceOut:0xc8201a4b40 qor_admin.consumable_outs.attributes.Name:0xc8201a5640 qor_admin.Save:0xc8200134c0 qor_admin.client_device_ins.attributes.客户名:0xc820013f80 qor_admin.consumable_ins.attributes.设备名:0xc8201225c0 qor_admin.device_ins.attributes.Device Name:0xc8201a4d00 qor_admin.Show All:0xc820013580 qor_admin.report_items.attributes.Device Name:0xc820013640 qor_admin.device_outs.attributes.Device Name:0xc820123cc0 qor_admin.更新后的库存数量不能小于零,在库0:0xc820656940 qor_admin.CustomerDeviceOutcomings:0xc820012f40 qor_admin.日常操作:0xc820013940 qor_admin.devices.attributes.Category ID:0xc820123540 qor_admin.device_outs.attributes.Quantity:0xc820123d00 qor_admin.qor_admin.consumable_ins.Add ConsumableIn:0xc8201a5ec0 qor_admin.DeviceOuts:0xc820013bc0 qor_admin.client_device_ins.attributes.设备名:0xc820122000 qor_admin.Search:0xc820123080 qor_admin.employees.attributes.Mobile:0xc8201237c0 qor_admin.consumable_outs.attributes.设备数量:0xc820122740 qor_admin.employees.attributes.Name:0xc820123780 qor_admin.consumable_ins.attributes.Device Name:0xc8201a5d40 qor_admin.qor_admin.warehouses.Warehouses:0xc820656540 qor_admin.ConsumableIns:0xc820013ec0 qor_admin.client_device_outs.attributes.仓库:0xc820122200 qor_admin.qor_admin.customer_device_incomings.设备名:0xc820013d40 qor_admin.consumable_outs.attributes.设备代码:0xc8201226c0 qor_admin.收入到的仓库不能为空:0xc820122a40 qor_admin.人事管理:0xc820013080 qor_admin.consumables.attributes.Code:0xc820013200 qor_admin.device_outs.attributes.From Warehouse Name:0xc820123c40 qor_admin.qor_admin.device_outs.By Whom Name:0xc8201a4ac0 qor_admin.Exit Bulk Edit:0xc820013340 qor_admin.qor_admin.client_device_ins.Add ClientDeviceIn:0xc8201223c0 qor_admin.device_ins.attributes.ID:0xc8201a4c00 qor_admin.consumable_ins.attributes.Report Item ID:0xc8201a5f40 qor_admin.qor_admin.client_device_outs.Device Name:0xc820656340 qor_admin.DeviceIns:0xc820013b80 qor_admin.qor_admin.client_device_ins.Edit ClientDeviceIn:0xc820122440 qor_admin.Warehouses:0xc8201227c0 qor_admin.qor_admin.device_ins.DeviceIns:0xc8201a4bc0 qor_admin.Target:0xc8200132c0 qor_admin.qor_admin.report_items.Device Code:0xc820122c40 qor_admin.device_ins.attributes.From Report Item ID:0xc8201a4c40 qor_admin.qor_admin.consumable_outs.Quantity:0xc8201a5b80 qor_admin.qor_admin.client_device_ins.By Whom:0xc820123a80 qor_admin.数量输入有误,不能大于10:0xc8201a4900 qor_admin.qor_admin.device_ins.By Whom Name:0xc8201a5500 qor_admin.consumable_outs.attributes.By Whom ID:0xc8201a5a80 qor_admin.qor_admin.client_device_outs.Edit ClientDeviceOut:0xc820656240 qor_admin.Save Changes:0xc820013a00 qor_admin.qor_admin.devices.Name:0xc8201235c0 qor_admin.qor_admin.report_items.Who Has Them Name:0xc820123b00 qor_admin.device_outs.attributes.By Whom Name:0xc820123d80 qor_admin.qor_admin.device_ins.Edit DeviceIn:0xc8201a5300 qor_admin.consumable_ins.attributes.设备代码:0xc820122600 qor_admin.qor_admin.client_device_ins.Quantity:0xc820123a40 qor_admin.代码已经存在了,不能重复:0xc820656880 qor_admin.Copy All:0xc820013380 qor_admin.consumable_ins.attributes.设备数量:0xc820122640 qor_admin.device_ins.attributes.By Whom ID:0xc8201a5040 qor_admin.consumable_outs.attributes.Code:0xc8201a5680 qor_admin.report_items.attributes.Operated By Whom:0xc820122b00 qor_admin.report_items.attributes.Who Has Them Name:0xc820122e40 qor_admin.translations.attributes.Translations:0xc820656a80 qor_admin.qor_admin.device_ins.Quantity:0xc8201a54c0 qor_admin.resource_successfully_updated:0xc820656840 qor_admin.Cancel:0xc8200139c0 qor_admin.client_device_outs.attributes.By Whom:0xc820122d40 qor_admin.client_device_outs.attributes.Quantity:0xc8201232c0 qor_admin.qor_admin.devices.Category ID:0xc8201236c0 qor_admin.qor_admin.consumable_outs.Edit ConsumableOut:0xc8201a5ac0 qor_admin.qor_admin.employees.Add Employee:0xc820656740 qor_admin.消耗品管理:0xc820013140 qor_admin.Saved:0xc820013440 qor_admin.系统设置:0xc820013180 qor_admin.customer_device_incomings.attributes.客户名:0xc820013700 qor_admin.client_device_outs.attributes.Device Name:0xc820123240 qor_admin.device_outs.attributes.To Whom ID:0xc820123f80 qor_admin.consumable_outs.attributes.Device Name:0xc8201a5700 qor_admin.qor_admin.warehouses.Add Warehouse:0xc8206567c0 qor_admin.consumables.attributes.设备名:0xc820013c00 qor_admin.选择收入过的客户设备:0xc820122e00 qor_admin.qor_admin.employees.Mobile:0xc820123880 qor_admin.customer_device_incomings.attributes.设备名:0xc8200137c0 qor_admin.qor_admin.customer_device_incomings.仓库:0xc820013dc0 qor_admin.不能为空:0xc820122980 qor_admin.employees.attributes.ID:0xc820123740 qor_admin.Source:0xc820013280 qor_admin.Are you sure?:0xc820013540 qor_admin.consumable_outs.attributes.Warehouse Name:0xc8201a5800 qor_admin.consumable_outs.attributes.Date:0xc8201a5900 qor_admin.Bulk Edit:0xc820013300 qor_admin.qor_admin.client_device_ins.Date:0xc820123ac0 qor_admin.client_device_ins.attributes.Warehouse:0xc820122800 qor_admin.device_outs.attributes.From Report Item ID:0xc820123ec0 qor_admin.qor_admin.devices.ID:0xc820123580 qor_admin.device_outs.attributes.To Whom Name:0xc820123c00 qor_admin.device_ins.attributes.To Warehouse ID:0xc8201a4dc0 qor_admin.qor_admin.consumable_outs.To Whom Name:0xc8201a5bc0 qor_admin.client_device_outs.attributes.Date:0xc820122240 qor_admin.ConsumableOuts:0xc820122280 qor_admin.consumable_outs.attributes.Quantity:0xc8201a5740 qor_admin.qor_admin.report_items.Operated By Whom:0xc820122c80 qor_admin.带出设备的数量要大于0:0xc820122f40 qor_admin.consumable_ins.attributes.Date:0xc8201a5e80 qor_admin.qor_admin.consumable_ins.By Whom Name:0xc820656180 qor_admin.client_device_ins.attributes.By Whom:0xc820122940 qor_admin.qor_admin.device_ins.From Whom Name:0xc8201a5340 qor_admin.consumable_outs.attributes.Count:0xc8201a56c0 qor_admin.client_device_ins.attributes.Client Name:0xc820122840 qor_admin.ReportItems:0xc820013040 qor_admin.customer_device_incomings.attributes.仓库:0xc820013a80 qor_admin.qor_admin.device_outs.Add DeviceOut:0xc820123e80 qor_admin.qor_admin.device_outs.From Warehouse Name:0xc8201a49c0 qor_admin.qor_admin.device_ins.Add DeviceIn:0xc8201a5240 qor_admin.qor_admin.consumable_ins.Date:0xc8206561c0 qor_admin.Clients:0xc8200130c0 qor_admin.qor_admin.report_items.ReportItems:0xc8200135c0 qor_admin.consumable_ins.attributes.By Whom ID:0xc8201a5fc0 qor_admin.qor_admin.employees.Employees:0xc820123700 qor_admin.qor_admin.employees.Name:0xc820123840 qor_admin.devices.attributes.Code:0xc820123480 qor_admin.devices.attributes.Warehouse ID:0xc820123500 qor_admin.qor_admin.client_device_ins.Client Name:0xc820123900 qor_admin.device_outs.attributes.By Whom ID:0xc8201a4840 qor_admin.qor_admin.consumable_outs.By Whom Name:0xc8201a5c80 qor_admin.qor_admin.translations.Translations:0xc820656a00 qor_admin.ClientDeviceOuts:0xc820013e80 qor_admin.client_device_ins.attributes.Device Name:0xc8201228c0 qor_admin.qor_admin.client_device_ins.客户名:0xc8201224c0 qor_admin.qor_admin.client_device_ins.Warehouse:0xc820123a00 qor_admin.qor_admin.consumable_outs.ConsumableOuts:0xc8201a5580 qor_admin.consumable_ins.attributes.Quantity:0xc8201a5d80 qor_admin.qor_admin.consumable_ins.Device Name:0xc820656080 qor_admin.Consumables:0xc820012f80 qor_admin.Copy:0xc8200133c0 qor_admin.device_ins.attributes.By Whom Name:0xc8201a5080 qor_admin.qor_admin.consumable_outs.Device Name:0xc8201a5b40 qor_admin.client_device_outs.attributes.客户名:0xc820122100 qor_admin.qor_admin.devices.Code:0xc820123600 qor_admin.qor_admin.client_device_ins.ClientDeviceIns:0xc8201230c0 qor_admin.qor_admin.consumable_outs.Date:0xc8201a5cc0 qor_admin.qor_admin.warehouses.Name:0xc8206566c0 qor_admin.Actions:0xc820013240 qor_admin.带出设备不能为空:0xc820122ec0 qor_admin.consumable_outs.attributes.To Whom Name:0xc8201a5780 qor_admin.CustomerDeviceIncomings:0xc820012f00 qor_admin.devices.attributes.Name:0xc820123440 qor_admin.qor_admin.client_device_ins.Device Name:0xc820123980 qor_admin.qor_admin.employees.Edit Employee:0xc820656780 qor_admin.client_device_outs.attributes.设备名:0xc820122180 qor_admin.devices.attributes.ID:0xc820123400 qor_admin.qor_admin.device_ins.To Warehouse Name:0xc8201a5380 qor_admin.qor_admin.consumable_outs.Add ConsumableOut:0xc8201a5940 qor_admin.devices.attributes.Total Quantity:0xc8201234c0 qor_admin.translations.attributes.Backends:0xc820656a40 qor_admin.client_device_outs.attributes.Client Device In ID:0xc820122d80 qor_admin.client_device_outs.attributes.Client Name:0xc8201231c0 qor_admin.Next Page:0xc820656800 qor_admin.qor_admin.client_device_ins.设备名:0xc820122500 qor_admin.qor_admin.devices.Add Device:0xc8201a48c0 qor_admin.qor_admin.client_device_outs.ClientDeviceOuts:0xc820123140 qor_admin.consumable_outs.attributes.ID:0xc8201a5600 qor_admin.qor_admin.devices.Total Quantity:0xc820123640 qor_admin.qor_admin.device_outs.Date:0xc8201a4b00 qor_admin.qor_admin.employees.ID:0xc820123800 qor_admin.resource_successfully_created:0xc8201238c0 qor_admin.device_outs.attributes.Date:0xc820123e40 qor_admin.收入设备名不能为空:0xc8201229c0 qor_admin.设备带出人不能为空:0xc820122f00 qor_admin.qor_admin.consumable_outs.Warehouse Name:0xc8201a5c00 qor_admin.qor_admin.devices.Warehouse ID:0xc820123680 qor_admin.qor_admin.device_outs.Quantity:0xc8201a4a80 qor_admin.device_ins.attributes.From Whom Name:0xc8201a4cc0 qor_admin.consumable_ins.attributes.Warehouse Name:0xc8201a5dc0 qor_admin.qor_admin.client_device_outs.Date:0xc820656500 qor_admin.warehouses.attributes.Address:0xc820656640 qor_admin.Translation:0xc820013400 qor_admin.qor_admin.customer_device_incomings.客户名:0xc820013cc0 qor_admin.qor_admin.warehouses.ID:0xc820656680 qor_admin.请选择操作员:0xc820122ac0 qor_admin.consumable_outs.attributes.Report Item ID:0xc8201a59c0 qor_admin.qor_admin.consumable_ins.Edit ConsumableIn:0xc820656000 qor_admin.qor_admin.client_device_outs.Warehouse Name:0xc820656400 qor_admin.warehouses.attributes.ID:0xc820656580 qor_admin.warehouses.attributes.Name:0xc8206565c0 qor_admin.qor_admin.device_outs.To Whom Name:0xc8201a4980 qor_admin.device_ins.attributes.To Warehouse Name:0xc8201a4e00 qor_admin.powered_by:0xc820123000 qor_admin.qor_admin.device_ins.Date:0xc8201a5540 qor_admin.client_device_ins.attributes.Date:0xc8201220c0 qor_admin.client_device_outs.attributes.取出仓库:0xc8201222c0 qor_admin.qor_admin.client_device_outs.Client Name:0xc8206562c0 qor_admin.qor_admin.report_items.Who Has Them:0xc820122b80 qor_admin.consumable_outs.attributes.By Whom Name:0xc8201a5880 qor_admin.收入设备的数量要大于0:0xc820122a80 qor_admin.qor_admin.device_ins.Device Name:0xc8201a5480 qor_admin.zh_CN:0xc820656200 qor_admin.更新后的库存数量不能小于零:0xc8206568c0 qor_admin.customer_device_outcomings.attributes.设备名:0xc8200138c0 qor_admin.consumable_outs.attributes.设备名:0xc820122680 qor_admin.ClientDeviceIns:0xc820013e40 qor_admin.device_ins.attributes.Quantity:0xc8201a4d40 qor_admin.report_items.attributes.Who Has Them:0xc820013600 qor_admin.report_items.attributes.Device Code:0xc820013680 qor_admin.qor_admin.device_outs.DeviceOuts:0xc820123b80]]}
2015/08/20 03:34:48.062781 route.go:181: Finish [GET] /admin/translations Took 14.63ms


select_one meta data not show

type User struct {
    gorm.Model
    Mobile string
    Name   string
    Role   string
}
user := adm.AddResource(&models.User{}, &admin.Config{Menu: []string{"User Management"}})

    user.Meta(&admin.Meta{
        Name:       "Name",
        Label:      "Name",
        Type:       "select_one",
        Collection: []string{"test01", "test02", "test03"},
        Valuer: func(value interface{}, context *qor.Context) interface{} {
            if value == nil {
                log.Println("null value")
                return nil
            }
            user := value.(*models.User)
            log.Println("user", user)
            return user.Name
        },
    })

worked for admin edit and new, but the index view is empty. (name is saved to database correctly).

If without select_one type, everything goes correctly.

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

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.