From: Dick K. <D.J...@ch...> - 2003-08-13 09:00:45
|
Hi there, We are using pyPgSQL for a fairly complex system, and sofar everything worked very nicely, especially in combination with SQLDict. With the new version (2.4) however, there seems to be a problem with the description list. The following code is used to get the description of the fields from a table: --------- snip ---------------- def __BldTabDef(self): """ Bouw gegevens over de te onderhouden tabel op """ Sqlstmt = 'Select * from ' + self.table veldlist = [] Opendb.TableObjs.hcur.execute(Sqlstmt) rr = Opendb.TableObjs.hcur.fetchone() for x in Opendb.TableObjs.hcur.description: veldnm = strip(x[0]) self.__GetFldDefinition(veldnm,x) veldlist.append(veldnm) self.columns = tuple(veldlist) setattr(self.__class__,"columns",self.columns) --------- snip ---------------- This way I don't need to specify the columns in the Class definitions of the SQLDict definition of the objects. I am also using the length parameter of the fields. In the previous version of pyPgSQL this was all working perfectly. However, in the current version, if I have a char field, no length is returned. So the program crashes when it wants to use this length. Has anyone had any experience with this? Kind regards, D.Kniep |