changeset 1:fef9ad4020ee

sql change
author dwinter
date Wed, 31 Oct 2012 16:35:12 +0100
parents 08a476cdcfea
children fb2a3b4542a4
files manageIndexMetaPURLs.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/manageIndexMetaPURLs.py	Wed Oct 31 14:57:53 2012 +0100
+++ b/manageIndexMetaPURLs.py	Wed Oct 31 16:35:12 2012 +0100
@@ -30,7 +30,7 @@
     # server_url base_url of server
   
     def __init__(self):
-        self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="XXXX")
+        self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="p*lWa55eR",host="localhost")
       
     
     
@@ -51,7 +51,8 @@
             
     
     def getPurl(self,path):  
-        urls = self.purlDB.select('"purls"',where="path='%s'"%path)
+        #urls = self.purlDB.select('"purls"',where="path=%s"%web.sqlquote(path.replace("'"))
+        urls = self.purlDB.query("select * from purls where path=$path",vars={'path':path})
         if urls is None or len(urls)==0:
             return None
         else:
@@ -156,4 +157,4 @@
     
     im = IndexMetaPURLManager()
     print im.register("/tmp3/index.meta", True, "", "dwinter")
-    pass
\ No newline at end of file
+    pass