storage/folder: + parent query
This commit is contained in:
parent
8aed67f057
commit
919119d649
2 changed files with 10 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
(:local-nicknames (:shape :scopes/shape)
|
(:local-nicknames (:shape :scopes/shape)
|
||||||
(:tracking :scopes/storage/tracking)
|
(:tracking :scopes/storage/tracking)
|
||||||
(:util :scopes/util))
|
(:util :scopes/util))
|
||||||
(:export #:folder #:root #:create #:items
|
(:export #:folder #:root #:create #:items #:parent
|
||||||
#:make-container))
|
#:make-container))
|
||||||
|
|
||||||
(in-package :scopes/storage/folder)
|
(in-package :scopes/storage/folder)
|
||||||
|
@ -34,8 +34,13 @@
|
||||||
(pid (tracking:id-str parent)))
|
(pid (tracking:id-str parent)))
|
||||||
(tracking:save (tracking:make-item cont pid name))))
|
(tracking:save (tracking:make-item cont pid name))))
|
||||||
|
|
||||||
(defun items (parent)
|
(defun items (f)
|
||||||
(query parent `((:parentid ,(id parent)))))
|
(query f `((:parentid ,(id f)))))
|
||||||
|
|
||||||
|
(defun parent (f)
|
||||||
|
(let ((pid (parse-integer (util:keyword-to-string (shape:head-value f :parentid)))))
|
||||||
|
(tracking:query-one (tracking:container f)
|
||||||
|
(tracking:make-where `((:trackid ,pid))))))
|
||||||
|
|
||||||
;;;; auxiliary functions
|
;;;; auxiliary functions
|
||||||
|
|
||||||
|
|
|
@ -100,4 +100,6 @@
|
||||||
(setf r1 (folder:items root))
|
(setf r1 (folder:items root))
|
||||||
(== (length r1) 1)
|
(== (length r1) 1)
|
||||||
(== (shape:head-value (car r1) :ref) :dummy-0)
|
(== (shape:head-value (car r1) :ref) :dummy-0)
|
||||||
|
(setf f2 (folder:parent (car r1)))
|
||||||
|
(== (tracking:trackid f2) 1)
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Reference in a new issue