]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
(no commit message)
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 Sep 2005 04:50:21 +0000 (04:50 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 Sep 2005 04:50:21 +0000 (04:50 +0000)
doc/build/components/formatting.myt
doc/build/content/datamapping.myt

index 437dd17ebcf96a8f5564d143b49255d9a98e4181..9fe39286b7700331eb723c4a0ca358e83df650e6 100644 (file)
 <%args>
     title = None
     syntaxtype = 'python'
+    html_escape = False
 </%args>
 
 <%init>
 
         return g.rstrip()
 
-    content = highlight.highlight(fix_indent(m.content()), syntaxtype = syntaxtype)
+    content = highlight.highlight(fix_indent(m.content()), html_escape = html_escape, syntaxtype = syntaxtype)
 
 </%init>
 <div class="code">
@@ -368,20 +369,56 @@ __FORMAT:LINK{<%path%><% extra and "|" + extra or "" %><% text and "@text=" + te
 %
 </%method>
 
-#<&| /components/uniqueblock.mhtml, blockname=>'popboxscript', uniquename=>$name &>
-#        <script>
-#                function togglePopbox(id, show, hide) {
-#                        var link = document.getElementById(id + "_link");
-#                        var div = document.getElementById(id + "_div");
-#                        if (div.style.display == 'block') {
-#                                div.style.display = 'none';
-#                                link.firstChild.nodeValue = show;
-#                        }
-#                        else if (div.style.display == 'none') {
-#                                div.style.display = 'block';
-#                                link.firstChild.nodeValue = hide;
-#                        }
-#                }
-#
-#        </script>
-#</&>
+<%method popboxlink trim="both"> 
+    <%args>
+        name=None
+        show='show'
+        hide='hide'
+    </%args>
+    <%init>
+        if name is None:
+            name = m.attributes.setdefault('popbox_name', 0)
+        m.attributes['popbox_name'] += 1
+        name = "popbox_" + repr(name)
+    </%init>
+javascript:togglePopbox('<% name %>', show, hide)
+</%method>
+<%method popbox>
+<%args>
+    name = None
+</%args>
+<%init>
+    if name is None:
+        name = 'popbox_' + repr(m.attributes['popbox_name'])
+</%init>
+<&| SELF:uniqueblock, blockname='popboxscript', uniquename=name &>
+        <script>
+                function togglePopbox(id, show, hide) {
+                        var link = document.getElementById(id + "_link");
+                        var div = document.getElementById(id + "_div");
+                        if (div.style.display == 'block') {
+                                div.style.display = 'none';
+                                if (link) {
+                                    link.firstChild.nodeValue = show;
+                                }
+                        }
+                        else if (div.style.display == 'none') {
+                                div.style.display = 'block';
+                                if (link) {
+                                link.firstChild.nodeValue = hide;
+                                }
+                        }
+                }
+
+        </script>
+</&>
+<div id="<% name %>_div"><% m.content() %></div>
+</%method>
+
+<%method codepopper>
+    <%args>
+        link
+    </%args>
+    <a href="<& SELF:popboxlink &>">link</a>
+    <&|SELF:popbox&><% m.content() %></&>
+</%method>
\ No newline at end of file
index 723dc8ce73cdc732f1f292d5250e1564d8322803..a5644f32b00dc276e4beffb6749efacffddb12d9 100644 (file)
@@ -26,8 +26,9 @@
         m = mapper(User, users)
         
         # select
-        user = m.select(users.c.user_name == 'fred')[0]
-        
+        <&|formatting.myt:codepopper, link="user = m.select(users.c.user_name == 'fred')[0]" &>
+        sql sql sql sql 
+        </&>
         # modify
         user.user_name == 'fred jones'