Re: [SQLObject] StringCol with variable sized TEXT columns
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-12-06 21:51:58
|
Carlos Ribeiro wrote: > As per the documentation: > > "StringCol represents CHAR, VARCHAR, and TEXT. The length keyword > argument indicates the CHAR or VARCHAR length -- if not given, then > TEXT is assumed. If you use varchar=False then CHAR will be used, > otherwise VARCHAR is the default." > > But when I tried: > > <-- rest of the declaration ommited --> > 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 The lines don't match up with the current checkout, but the only place I see that line is for DecimalCol, not StringCol. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |