I've been planning on writing this for a long time, but never got
around to it.
I've been filtering my datagrids the following way:
(defun make-users-gridedit ()
(make-instance 'gridedit
:name 'users-grid
:data-class 'user
:view 'user-table-view
:widget-prefix-fn (lambda (&rest args)
(declare (ignore args))
(with-html (:h1 "Users")))
:item-data-view 'user-data-view
:item-form-view 'user-form-view
;; HERE !!!
:on-query (list :filter #'(lambda (obj)(eq (user-rank
obj) :user)))
))
That is using the :on-query initarg. Not sure now, but I think I saw
an example somewhere that was passing some SQL clauses to :on-query,
read the source and saw that it supports functions too.
Now for the fix part. Using a clean checkout of weblocks-dev I get
"invalid keyword argument: :FILTER (valid keys are )" using SBCL on
Linux. The small fix is to add &allow-other-keys to count-persistent-
objects function signature. Hopefully this can be incorporated in
weblocks.
Cheers,
Ury
--- weblocks-dev/src/store/store-api.lisp 2011-03-08
01:01:49.025888002 +0200
+++ weblocks-dev2/src/store/store-api.lisp 2010-07-29
12:36:56.514067563 +0300
@@ -123,7 +123,7 @@
Other implementation dependent keys may be defined by a given
store."))
-(defgeneric count-persistent-objects (store class-name &key)
+(defgeneric count-persistent-objects (store class-name &key &allow-
other-keys)
(:documentation "Returns the number of persistent objects stored in
'store' of 'class-name', bound by the given keyword parameters. For
documentation of keyword parameters, see
--
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en.