From: G. <fra...@cl...> - 2003-06-25 09:07:00
|
Hello, I'm creating an object mapping over an existing database which contains tab= le with varchar as primary key and consequently as id. I first tried to follow the common way and then I got the following type er= ror : Traceback (most recent call last): File "ORM.py", line 29, in ? print labo File "/usr/lib/python2.2/site-packages/SQLObject/SQLObject.py", line 837,= in _ _repr__ ' '.join(['%s=3D%s' % (name, repr(value)) for name, value in self._repr= Items()])) TypeError: an integer is required the original code in SQLObject.py was : def __repr__(self): return '<%s %i %s>' \ % (self.__class__.__name__, self.id, ' '.join(['%s=3D%s' % (name, repr(value)) for name, value= in self._reprItems()])) I've turned it into : def __repr__(self): return '<%s %s %s>' \ ....^^.... and then all work fine ! Is there a better way to do that (better than modifying the source code ;) = ? Is it so imperative to use integer as id (except for automatic id generat= ion) ? Thanks for any help and for the great work of the author ! -------------------- Fran=E7ois Girault |