From Nico.Latzer at R-KOM.de Fri Jul 16 13:06:36 2004 From: Nico.Latzer at R-KOM.de (Latzer Nico) Date: Fri Jul 16 10:54:03 2004 Subject: [orm-devel] Proposal datasource selectResult Message-ID: <09DBFC8BDA15D411A41D0090275130BC7E4A8D@ffserver> maybe it would be useful for others too, if one could use a specialized selectResult-Klass sth. like class mySelectResult(datasource.selectResult): def afterfetch(self, o): return o.__class__.__bases__.mangled() ds=datasource() ds._selectResult=mySelectResult Example Implementation (datasource.py): class datasource_base: ... _selectResult=None def runSelect(self, dbclass, query): """ Common stuff from rselect and selectByClause """ cursor = self.execute(query) ! x = self._selectResult or selectResult ! result = x(self, dbclass, cursor) return result class selectResult ... - def afterfetch(self, o): #do sth with the ob, default to leave unchanged - return o def fetchone(self): """ Return a new instance of dbclass constructed from the data returned by a fetchone() call on our cursor. Return None if ther're no rows left. """ ! return self.afterfetch(.. def fetchall(self): #similar Regards, --Nico