Commit 8acd93a7 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

added custom programmatic filtering ORM hack

parent ad856dbd
......@@ -519,7 +519,6 @@
r (cons (update-widget 'toggle-button (get-id id) 'checked 0) r)))
'() id-list))
;; fill out the widget from the current entity in the memory store
;; dispatches based on widget type
(define (mupdate widget-type id-symbol key)
......
......@@ -311,8 +311,6 @@
(cdr s)))))
(define (validate db)
;; check attribute for duplicate entity-id/attribute-ids
0)
......
......@@ -457,6 +457,8 @@
(define (edit-text-listener t) (list-ref t 6))
(define (button id text text-size layout listener) (list "button" id text text-size layout listener))
(define (button-listener t) (list-ref t 5))
(define (image-button id image layout listener) (list "image-button" id image layout listener))
(define (image-button-listener t) (list-ref t 4))
(define (toggle-button id text text-size layout style listener) (list "toggle-button" id text text-size layout style listener))
(define (toggle-button-listener t) (list-ref t 6))
(define (seek-bar id max layout listener) (list "seek-bar" id max layout listener))
......@@ -729,6 +731,7 @@
(cond
((equal? (widget-type w) "edit-text") (edit-text-listener w))
((equal? (widget-type w) "button") (button-listener w))
((equal? (widget-type w) "image-button") (image-button-listener w))
((equal? (widget-type w) "toggle-button") (toggle-button-listener w))
((equal? (widget-type w) "seek-bar") (seek-bar-listener w))
((equal? (widget-type w) "spinner") (spinner-listener w))
......@@ -885,6 +888,8 @@
((callback-fn cb) (car args)))
((equal? (callback-type cb) "button")
((callback-fn cb)))
((equal? (callback-type cb) "image-button")
((callback-fn cb)))
((equal? (callback-type cb) "toggle-button")
((callback-fn cb) (car args)))
((equal? (callback-type cb) "seek-bar")
......
......@@ -919,11 +919,14 @@
(map
(lambda (e)
(msg (ktv-get e "gender"))
(let ((gender (ktv-get e "gender")))
(text-view
(let* ((image-name (ktv-get e "photo"))
(image (if (or (not image-name) (equal? image-name "none"))
"face" (string-append "/sdcard/symbai/files/" image-name))))
(msg image)
(image-button
(make-id (string-append "chooser-" (ktv-get e "unique_id")))
(string-append (ktv-get e "unique_id") ": " (if (null? gender) "not set" gender))
30 (layout 'wrap-content 'wrap-content 1 'centre 5))))
image (layout 'wrap-content 'wrap-content 1 'centre 5)
(lambda () '()))))
(db-filter db "sync" "individual"
(list (make-filter "gender" "varchar" "=" "female")))))))
(lambda (activity) '())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment