fixes from sunrise
authorDrew Crampsie <drewc@tech.coop>
Thu, 2 Mar 2006 09:49:26 +0000 (01:49 -0800)
committerDrew Crampsie <drewc@tech.coop>
Thu, 2 Mar 2006 09:49:26 +0000 (01:49 -0800)
darcs-hash:20060302094926-5417e-19b82319570c4742c07b89eda68a1b0586d50242.gz

src/slot-presentations/date.lisp
src/validation.lisp

index 161b31c..ac34d9b 100644 (file)
@@ -76,7 +76,7 @@
 (defclass %date-field (date-field)
   ((day :component (%integer-range-field :min-value 1 :max-value 31))
    (month :component (%integer-range-field :min-value 1 :max-value 12))
-   (year :component (%integer-range-field :min-value 2005 :max-value 2015) ))
+   (year :component (%integer-range-field :min-value 2006 :max-value 2015) ))
   (:metaclass standard-component-class))
 
 (defmethod shared-initialize :after ((field %date-field) slot-names
@@ -241,4 +241,4 @@ form."))
     (iterate
       (for value from (min-value range) to (max-value range))
       (<:option :value value :selected (= value (lisp-value range))
-                (<:as-html value)))))
\ No newline at end of file
+                (<:as-html value)))))
index e118727..d013218 100644 (file)
@@ -77,7 +77,17 @@ Returns T if the ATTRIBUTE-VALUE in INSTANCE passes all the validation functions
                :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 (attribute.plist attribute) :label))
+             :attribute attribute))))