mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 Candidate values of the database relation fields are no longer subject to view filtering https://github.com/siyuan-note/siyuan/issues/10411
This commit is contained in:
parent
0226bbb310
commit
aea30d12f7
3 changed files with 57 additions and 0 deletions
|
|
@ -38,6 +38,28 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func GetAttributeViewPrimaryKeyValues(avID string, page, pageSize int) (ret *av.KeyValues, err error) {
|
||||
waitForSyncingStorages()
|
||||
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if nil != err {
|
||||
logging.LogErrorf("parse attribute view [%s] failed: %s", avID, err)
|
||||
return
|
||||
}
|
||||
|
||||
ret = attrView.GetBlockKeyValues()
|
||||
if 1 > pageSize {
|
||||
pageSize = 50
|
||||
}
|
||||
start := (page - 1) * pageSize
|
||||
end := start + pageSize
|
||||
if len(ret.Values) < end {
|
||||
end = len(ret.Values)
|
||||
}
|
||||
ret.Values = ret.Values[start:end]
|
||||
return
|
||||
}
|
||||
|
||||
func GetAttributeViewFilterSort(id string) (filters []*av.ViewFilter, sorts []*av.ViewSort) {
|
||||
waitForSyncingStorages()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue