Oleg Broytmann wrote:
> On Mon, Dec 06, 2004 at 07:35:44PM -0200, Carlos Ribeiro wrote:
>
>> observacao = StringCol(notNone = False, default = '')
>>
>>I've got this:
>>
>>cribeiro@fiona:~/work/workflow $ python dbsidercom.py
>>Traceback (most recent call last):
>> File "dbsidercom.py", line 556, in ?
>> _wf = WorkflowBasico(DEFAULT_DB_FILENAME)
>> File "/home/cribeiro/work/workflow/dbworkflow.py", line 40, in __init__
>> self.defineCustomDB(db)
>> File "dbsidercom.py", line 60, in defineCustomDB
>> class dbNotaFiscal(SQLObject):
>> File "/usr/lib/python2.3/site-packages/sqlobject/main.py", line 177,
>>in __new__
>> newClass.addColumn(column)
>> File "/usr/lib/python2.3/site-packages/sqlobject/main.py", line 387,
>>in addColumn
>> column = columnDef.withClass(cls)
>> File "/usr/lib/python2.3/site-packages/sqlobject/col.py", line 286,
>>in withClass
>> return self.baseClass(soClass=soClass, name=self._name, **self.kw)
>> File "/usr/lib/python2.3/site-packages/sqlobject/col.py", line 600,
>>in __init__
>> assert self.size is not NoDefault, \
>>AssertionError: You must give a size argument
>
>
> What is your version of SQLObject? I can find only one such assert in
> col.py, in line 606 - in DecimalCol, not StringCol. Well, even in
> DecimalCol it's probably a bug, but that's another story.
No, it's required for DecimalCol -- databases require size and
precision. At least, the ones I know of do...? There's no default for
size, hence the assertion.
--
Ian Bicking / ia...@co... / http://blog.ianbicking.org
|