On Sat, Apr 17, 2010 at 01:25:59PM +0300, Imri Goldberg wrote: > 1. Create a simple table with a decimal column, for example: > > class MyThing(sqlobject.SQLObject): > bla1 = sqlobject.DecimalCol(size = 10, precision = 2) > > 2. Use sqlobject-admin create --egg=... -c sqlite://.... > 3. Use sqlobject-admin status --egg=... -c sqlite://... [skip] > File > "D:\applic\program\python25\lib\site-packages\sqlobject-0.12.1-py2.5.egg\ > sqlobject\manager\command.py", line 765, in command > col = col.withClass(soClass) > File > "D:\applic\program\python25\lib\site-packages\sqlobject-0.12.1-py2.5.egg\ > sqlobject\col.py", line 408, in withClass > **self._kw) > File > "D:\applic\program\python25\lib\site-packages\sqlobject-0.12.1-py2.5.egg\ > sqlobject\col.py", line 1329, in __init__ > "You must give a size argument" > AssertionError: You must give a size argument > > After researching this issue a bit, I still haven't figured out whether this > is the result of a bug in the command implementation, or the way that > keyword arguments are handled in the column class hierarchy.
Ok, found the cause. CommandStatus in sqlobject/manager/command.py list columns using columnsFromScheme(), a kind of forced fromDatabase=True. And most connection classes don't recognize size/precision in DecimalCol'umns. In this particular case it would be enough, I think, to extend columnsFromScheme to pass None's as size/precision. I will do some experiments before committing the hack. Oleg. -- Oleg Broytman http://phd.pp.ru/ p...@phd.pp.ru Programmers don't die, they just GOSUB without RETURN. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss