--- MySQL.py.orig	2007-03-27 15:26:00.000000000 +1200
+++ MySQL.py	2007-03-27 15:51:40.000000000 +1200
@@ -16,6 +16,7 @@
 """
 
 import sys
+import string,re
 from MoinMoin import wikiutil, config
 import MySQLdb
 import re
@@ -27,6 +28,7 @@
 _re_evenattr=re.compile("EVENATTR (?P<EVENATTR>.*)")
 _re_oddattr=re.compile("ODDATTR (?P<ODDATTR>.*)")
 _re_wikicol=re.compile("WIKICOLUMN (?P<WIKICOLUMN>.*)")
+_re_wmlcol=re.compile("WMLCOLUMN (?P<WMLCOLUMN>.*)")
 _re_htmlcol=re.compile("HTMLCOLUMN (?P<HTMLCOLUMN>.*)")
 _re_mailcol=re.compile("MAILCOLUMN (?P<MAILCOLUMN>.*)")
 _re_hidden=re.compile("HIDDENCOLUMN (?P<HIDDENCOLUMN>.*)")
@@ -36,9 +38,10 @@
 <img src="/wiki/rightsidebar/img/moin-www.png"
 alt="[www]" width="11" height="11">%s</a>'''
 _format_wikiref=' <a href="%s">%s</a>'
-_format_mailto='<a href="mailto:%s">%s</a>'
+_format_wmlref=' <a href="%s">%s</a>'
+_format_mailto=' <a href="mailto:%s">%s</a>'
 
 class Preference:
     def __init__(self):
@@ -51,6 +54,7 @@
         self.header=''
         self.html=''
         self.wiki=''
+        self.wml=''
         self.mail=''
         self.hidden=''
 
@@ -91,6 +95,8 @@
 	output.append(params.linebreak)
         output.append('[WIKICOLUMN columnnumber1,columnnumber2,...,...]')
 	output.append(params.linebreak)
+        output.append('[WMLCOLUMN columnnumber1,columnnumber2,...,...] use | to separate two columns, aa|bb will become a link to aa labelled as bb')
+	output.append(params.linebreak)
         output.append('[MAILCOLUMN columnnumber1,columnnumber2,...,...]')
 	output.append(params.linebreak)
         output.append('[HIDDENCOLUMN columnnumber1,columnnumber2,...,...]')
@@ -148,6 +154,10 @@
         if match and match.groupdict().has_key('WIKICOLUMN'):
             params.wiki=match.group('WIKICOLUMN').split(',')
         
+        match=_re_wmlcol.search(parameterstring)
+        if match and match.groupdict().has_key('WMLCOLUMN'):
+            params.wml=match.group('WMLCOLUMN').split(',')
+
         match=_re_htmlcol.search(parameterstring)
         if match and match.groupdict().has_key('HTMLCOLUMN'):
             params.html=match.group('HTMLCOLUMN').split(',')
@@ -210,13 +220,17 @@
             aColumnNumber=aColumnNumber+1 
             element=unicode(str(aCell) , config.charset)
             if str(aColumnNumber) in params.hidden: 
-                    conitnue
+                    continue
             if str(aColumnNumber) in params.html: 
                     isHTML=1 
                     element=_format_href % (str(aCell), str(aCell) )
             if str(aColumnNumber) in params.wiki: 
                     isHTML=1
                     element=_format_wikiref % (str(aCell), str(aCell) )
+            if str(aColumnNumber) in params.wml:
+                    isHTML=1
+		    wml=str(aCell).split("|")
+                    element=_format_wmlref % (str(wml[0]), str(wml[1]) )
             if str(aColumnNumber) in params.mail: 
                     isHTML=1
                     element=_format_mailto % (str(aCell),str(aCell))
