Heya When I checked it, it seemed to me to happen because the 'size' and 'precision' were pop()-ed from the original **kw dict passed to DecimalCol. Since the this dict is later kept as a member, when used again by CommandStatus, 'size' and 'precision' are no longer there.
Hope that helps, Imri On Tue, Apr 20, 2010 at 7:23 PM, Oleg Broytman <p...@phd.pp.ru> wrote: > 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. > -- Imri Goldberg -------------------------------------- http://plnnr.com/ - automatic trip planning http://www.algorithm.co.il/blogs/ -------------------------------------- -- insert signature here ----
------------------------------------------------------------------------------
_______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss