package information is now stored in :type while jsonifying.
Thu Jun 26 06:00:53 PDT 2008 Ryszard Szopa <ryszard.szopa@gmail.com>
* package information is now stored in :type while jsonifying.
diff -rN -u old-cl-couch/object-layer/validated-document.lisp new-cl-couch/object-layer/validated-document.lisp
--- old-cl-couch/object-layer/validated-document.lisp 2014-07-25 01:24:23.000000000 -0700
+++ new-cl-couch/object-layer/validated-document.lisp 2014-07-25 01:24:23.000000000 -0700
@@ -124,7 +124,7 @@
(apply 'make-doc cl (alist-plist attributes)))
(defmethod make-doc ((cl (eql ',name)) &rest keys &key &allow-other-keys)
(let ((doc ; set default values
- (make-instance ',name :attributes (acons :type ,(symbol-name name) (plist-alist (list ,@initforms))))))
+ (make-instance ',name :attributes (acons :type ,(format nil "~a::~a" (package-name *package*) (symbol-name name)) (plist-alist (list ,@initforms))))))
(iter (for key in keys by #'cddr)
(for value in (cdr keys) by #'cddr)
(setf (@ doc key) value))
@@ -156,10 +156,10 @@
be applied on the results of a CouchDB query."))
(defmethod bless-doc (alist &optional type)
- (apply 'make-doc (or type (intern (@ alist :type))) (alist-plist alist)))
+ (apply 'make-doc (or type (read-from-string (@ alist :type))) (alist-plist alist)))
(defmethod bless-doc ((doc doc) &optional type)
- (change-class doc (or type (intern (@ doc :type)))))
+ (change-class doc (or type (read-from-string (@ doc :type)))))
;; Copyright (C) 2008
;; Ryszard Szopa <ryszard.szopa@gmail.com>