[PEAK] Newbie Question

Vital Lobachevsky tick at web.vi
Sun Dec 7 09:36:19 EST 2003


William Trenker wrote:
> [John Landahl advised:]
> Have you see the scrap of a tutorial in the PeakDatabaseApplications entry of the wiki?
> http://peak.telecommunity.com/DevCenter/PeakDatabaseApplications
> 
> I've tried the small tutorial "scrap" on the page you suggested and unfortunately I get a traceback:
> 
> from peak.api import binding, storage
> class Worker(binding.Component):
> 	db = binding.Obtain(storage.ISQLConnection)
> 	def doWork(self):
> 		for row in self.db('select name, description from aTable'):
> 			print row.name, row.description

Should be

     def doWork(self):
         storage.beginTransaction(self)
         for row in self.db('SELECT contactid, fullname FROM contacts'):
             print row.contactid, row.fullname
         storage.commitTransaction(self)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3146 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.eby-sarna.com/pipermail/peak/attachments/20031207/dd197044/smime.bin


More information about the PEAK mailing list