[MOBY-guts] biomoby commit

Yan Wong yanwong at pub.open-bio.org
Wed Apr 20 09:39:37 UTC 2005


yanwong
Wed Apr 20 05:39:37 EDT 2005
Update of /home/repository/moby/moby-live/Python/tutorials/webservices
In directory pub.open-bio.org:/tmp/cvs-serv21071/tutorials/webservices

Modified Files:
	dbwebservice.py 
Log Message:
added somme comments on the code

moby-live/Python/tutorials/webservices dbwebservice.py,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Python/tutorials/webservices/dbwebservice.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Python/tutorials/webservices/dbwebservice.py	2005/04/20 08:34:19	1.1
+++ /home/repository/moby/moby-live/Python/tutorials/webservices/dbwebservice.py	2005/04/20 09:39:37	1.2
@@ -13,11 +13,11 @@
 # MyQuery = """select rna, comment from table where locusCode = %s and id = %s"""
 # for more details on how to operate with the Python DB api see: http://www.python.org/topics/database
 
-MyQuery = """select rna, comment from table where locusCode = %s"""
+MyQuery = """select rna, comment from table where locusCode = :locusName"""
 
 def _toSQLParameters(queryData):
     """ Type of transformation:
-        [MobyObject, MobyObject, Parameter, Parameter] --> (sqlParameter1, sqlParameter2, ..)
+        [MobyObject, MobyObject, Parameter, Parameter] --> {'paramName1':sqlParameter1, 'paramName2':sqlParameter2, ...}
         an array of moby objects are transformed into a tuple of parameters
 
         ex, you want to retrieve from a database a RNA sequence given its AGI locusCode:
@@ -33,7 +33,7 @@
     """ Of course you can add more parameters and do all kind of checking
 
     """
-    return (identifier)
+    return {'locusName':identifier}
 
 def _formatter(results):
     """ Type of transformation:




More information about the MOBY-guts mailing list