[SQLObject] StringCol with variable sized TEXT columns
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Carlos R. <car...@gm...> - 2004-12-06 21:35:48
|
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 What's wrong here, the documentation or the StringCol constructor? -- Carlos Ribeiro Consultoria em Projetos blog: http://rascunhosrotos.blogspot.com blog: http://pythonnotes.blogspot.com mail: car...@gm... mail: car...@ya... |