[PEAK] Newbie Question

Vital Lobachevsky tick at web.vi
Sun Dec 7 09:37:02 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 name, description from aTable'):
             print row.name, row.description
         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/faf3bac4/smime.bin


More information about the PEAK mailing list