Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dave Griffiths
mongoose-2000
Commits
320d6d4b
Commit
320d6d4b
authored
Jun 19, 2014
by
Dave Griffiths
Browse files
review convert/validate single ids
parent
06ecbda4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
303 additions
and
91 deletions
+303
-91
android/assets/dbsync.scm
android/assets/dbsync.scm
+25
-2
android/assets/starwisp.scm
android/assets/starwisp.scm
+270
-82
eavdb/entity-filter.ss
eavdb/entity-filter.ss
+8
-7
No files found.
android/assets/dbsync.scm
View file @
320d6d4b
...
...
@@ -179,7 +179,7 @@
(
unique-id
(
update-entity
db
table
(
entity-id-from-unique
db
table
unique-id
)
(
list
ktv
)))
(
else
(
msg
"no values or no id to update as entity:"
unique-id
"values:"
value
)))))
(
msg
"no values or no id to update as entity:"
unique-id
"values:"
ktv
)))))
(
define
(
entity-reset!
)
...
...
@@ -698,11 +698,34 @@
(
string-append
dirname
"files/"
image-name
)))))
(
else
(
msg
"mupdate-widget unhandled widget type"
widget-type
))))
;(define (spinner-choice l i)
; (if (number? i)
; (symbol->string (list-ref l i))
; i))
;; spinner options are (list 'id-sym "Name") ...
(
define
(
spinner-choice
l
i
)
(
if
(
number?
i
)
(
symbol->string
(
list-ref
l
i
))
(
symbol->string
(
car
(
list-ref
l
i
))
)
i
))
(
define
(
spinner-index
l
s
)
(
define
(
_
l
n
s
)
(
cond
((
null?
l
)
0
)
((
eq?
(
car
(
car
l
))
s
)
n
)
((
_
(
cdr
l
)
(
+
n
1
)
s
))))
(
_
l
0
(
string->symbol
s
)))
(
define
(
spinner-index->name
l
i
)
(
define
(
_
l
n
)
(
cond
((
null?
l
)
"Unknown"
)
((
zero?
n
)
(
cadr
(
car
l
)))
((
_
(
cdr
l
)
(
-
n
1
)))))
(
_
l
i
))
(
define
(
mupdate-spinner
id-symbol
key
choices
)
(
let*
((
val
(
entity-get-value
key
)))
(
if
(
not
val
)
...
...
android/assets/starwisp.scm
View file @
320d6d4b
This diff is collapsed.
Click to expand it.
eavdb/entity-filter.ss
View file @
320d6d4b
...
...
@@ -60,7 +60,7 @@
(
else
c
)))
(
string->list
var
))))
(
define
(
build-query
table
filter
)
(
define
(
build-query
table
filter
typed
)
(
string-append
(
foldl
(
lambda
(
i
r
)
...
...
@@ -78,12 +78,13 @@
;; order by name
"join "
table
"_value_varchar "
"as n on n.entity_id = e.entity_id and n.attribute_id = 'name' "
;; ignore deleted
"join "
table
"_value_int "
;; ignore deleted
(if exists)
"
left
join "
table
"_value_int "
"as d on d.entity_id = e.entity_id and d.attribute_id = 'deleted' and "
"d.value = 0 "
)
"d.value = 0
or d.value = NULL
"
)
filter
)
"where e.entity_type = ? order by n.value"
))
(
if
typed
"where e.entity_type = ? order by n.value"
"order by n.value"
)))
(
define
(
build-args
filter
)
(
map
...
...
@@ -95,9 +96,9 @@
(
let
((
s
(
apply
db-select
(
append
(
list
db
(
build-query
table
filter
))
(
list
db
(
build-query
table
filter
(
not
(
equal?
type
"*"
))
))
(
build-args
filter
)
(
list
type
)))))
(
if
(
equal?
type
"*"
)
'
()
(
list
type
)))))
)
(
msg
(
db-status
db
))
(
if
(
null?
s
)
'
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment