Mercurial > urweb
comparison tests/crud.ur @ 368:b6be16792584
Removed handling of <,> as operators, for now
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 16 Oct 2008 14:17:55 -0400 |
parents | 28d3d7210687 |
children | 226c977faa9c |
comparison
equal
deleted
inserted
replaced
367:28d3d7210687 | 368:b6be16792584 |
---|---|
10 | 10 |
11 fun default (t ::: Type) (sh : show t) (rd : read t) (inj : sql_injectable t) | 11 fun default (t ::: Type) (sh : show t) (rd : read t) (inj : sql_injectable t) |
12 name : colMeta (t, string) = | 12 name : colMeta (t, string) = |
13 {Nam = name, | 13 {Nam = name, |
14 Show = txt _, | 14 Show = txt _, |
15 Widget = fn nm :: Name => <xml><textbox{nm}/></xml>, | 15 Widget = fn nm :: Name => (<xml><textbox{nm}/></xml>), |
16 WidgetPopulated = fn (nm :: Name) n => | 16 WidgetPopulated = fn (nm :: Name) n => |
17 <xml><textbox{nm} value={show _ n}/></xml>, | 17 (<xml><textbox{nm} value={show _ n}/></xml>), |
18 Parse = readError _, | 18 Parse = readError _,e |
19 Inject = _} | 19 Inject = _} |
20 | 20 |
21 val int = default _ _ _ | 21 val int = default _ _ _ |
22 val float = default _ _ _ | 22 val float = default _ _ _ |
23 val string = default _ _ _ | 23 val string = default _ _ _ |
24 | 24 |
25 fun bool name = {Nam = name, | 25 fun bool name = {Nam = name, |
26 Show = txt _, | 26 Show = txt _, |
27 Widget = fn nm :: Name => <xml><checkbox{nm}/></xml>, | 27 Widget = fn nm :: Name => (<xml><checkbox{nm}/></xml>), |
28 WidgetPopulated = fn (nm :: Name) b => | 28 WidgetPopulated = fn (nm :: Name) b => |
29 <xml><checkbox{nm} checked={b}/></xml>, | 29 (<xml><checkbox{nm} checked={b}/></xml>), |
30 Parse = fn x => x, | 30 Parse = fn x => x, |
31 Inject = _} | 31 Inject = _} |
32 | 32 |
33 functor Make(M : sig | 33 functor Make(M : sig |
34 con cols :: {(Type * Type)} | 34 con cols :: {(Type * Type)} |
94 </form></body></xml> | 94 </form></body></xml> |
95 | 95 |
96 fun delete (id : int) = | 96 fun delete (id : int) = |
97 () <- dml (DELETE FROM tab WHERE Id = {id}); | 97 () <- dml (DELETE FROM tab WHERE Id = {id}); |
98 return <xml><body> | 98 return <xml><body> |
99 The deed is done. | 99 The deed is done. |
100 </body></xml> | 100 </body></xml> |
101 | 101 |
102 fun confirm (id : int) = return <xml><body> | 102 fun confirm (id : int) = return <xml><body> |
103 <p>Are you sure you want to delete ID #{txt _ id}?</p> | 103 <p>Are you sure you want to delete ID #{txt _ id}?</p> |
104 | 104 |