fixed up wrappers .. we are this close to being fully functional!
[clinton/lisp-on-lines.git] / src / validation.lisp
index da39747..00cade6 100644 (file)
@@ -30,7 +30,7 @@ Returns T if the ATTRIBUTE-VALUE in INSTANCE passes all the validation functions
 
 
 (defmethod find-validation-functions (instance (attribute standard-attribute))
-  (getf (attribute.plist attribute) :validate-using))
+  (getf (description.properties attribute) :validate-using))
 
 
 ;;;; ** Instances
@@ -73,10 +73,22 @@ Returns T if the ATTRIBUTE-VALUE in INSTANCE passes all the validation functions
         (not (< 0 (length value))))
        (signal 'attribute-validation-condition
                :message (format nil "You must enter a value for ~A."
-                             (getf (attribute.plist attribute) :label))
+                                (getf (description.properties attribute) :label))
                :attribute attribute))))
 
 
+(defun validate-true (instance attribute)
+  
+  (warn "validate ~A ~A" instance attribute)
+  (let ((value (lol::attribute-value instance attribute)))
+    (warn "value is ~A" value)
+    (unless value 
+        
+      (signal 'attribute-validation-condition
+             :message (format nil "~A must be true."
+                              (getf (description.properties attribute) :label))
+             :attribute attribute))))
+