From: Maciej Pasternacki Date: Wed, 17 Dec 2008 22:12:42 +0000 (+0100) Subject: - Return term's ordering value as third value of TERM-VALUE. X-Git-Url: https://repo.or.cz/w/cl-trane.git/commitdiff_plain/db2d89fd6993641a8699599a911694cbefafda32 - Return term's ordering value as third value of TERM-VALUE. --- diff --git a/src/taxonomy.lisp b/src/taxonomy.lisp index 5776b2b..87db263 100644 --- a/src/taxonomy.lisp +++ b/src/taxonomy.lisp @@ -312,18 +312,21 @@ creation." 'item-term-order (null-or order)))) (defun term-value (item term - &aux (encoded (query (:select 'item-term-value :from 'item-term + &aux (encoded (query (:select 'item-term-value 'item-term-order + :from 'item-term :where (:and (:= 'item-id (id item)) (:= 'term-id (id term)))) - :single))) + :row))) "Returns value that association of ITEM and TERM is set to. As a second value returns T if an association was found at all, NIL otherwise. This makes it possible to tell between an -association with a NIL value and no association at all." +association with a NIL value and no association at all. + +Third value is a term ordering value, if ordering is set." (if encoded - (values (decode-value (taxonomy term) encoded) t) - (values nil nil))) + (values (decode-value (taxonomy term) (first encoded)) t (unless-null (second encoded))) + (values nil nil nil))) (defun (setf term-value) (new-value item term) "Set new value for association of ITEM and TERM.