Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
fieldtooltip: Parameter passing in Database API
Index: fieldtooltip/fieldtooltip.py
===================================================================
--- fieldtooltip/fieldtooltip.py (revision 11088)
+++ fieldtooltip/fieldtooltip.py (working copy)
@@ -51,10 +51,11 @@
pages = {}
cursor = db.cursor()
wiki_pages = WikiSystem(self.env).get_pages(FieldTooltip._wiki_prefix)
+ prefix_len = len(FieldTooltip._wiki_prefix)
for page in wiki_pages:
- cursor.execute("SELECT text FROM wiki WHERE name = '%s' ORDER BY version DESC LIMIT 1" % page)
+ cursor.execute("SELECT text FROM wiki WHERE name = %s ORDER BY version DESC LIMIT 1", (page,))
for text, in cursor:
- pages[page[len(FieldTooltip._wiki_prefix):]] = text
+ pages[page[prefix_len:]] = text
return pages
# ITemplateStreamFilter methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.