[Ml-yokadi] yokadid updates and somes questions

Aurélien Gâteau aurelien.gateau
Mer 3 Déc 19:29:59 CET 2008


Sébastien Renard wrote:
> Le lundi 1 décembre 2008, Aurélien Gâteau a écrit :
>> - Make it possible to run update.py from outside its dir
> 
> Done (commit 0d399af).

Thanks

> By the way, I try the update process (to test my change) and was unable to run 
> it properly because of the following error in update1to2 script : 
> 
> ---------------8<------------------------------------------------------------
> Found version 1
> Running ./update/update1to2
> Traceback (most recent call last):
>   File "./update/update1to2", line 57, in ?
>     main()
>   File "./update/update1to2", line 52, in main
>     alterProjectTable()
>   File "./update/update1to2", line 38, in alterProjectTable
>     Project.addColumn(BoolCol("active", default=True), changeSchema=True)
> AttributeError: type object 'Project' has no attribute 'addColumn'
> Update failed.
> ---------------8<------------------------------------------------------------
> 
> Indeed, there's no addColumn method in SQLObject object, at least in my 
> sqlobect release (0.10.2). 
> It is a static method of sqlmeta class (but there's dynamic weird stuff that I 
> don't fully understand in SQLObject code...).
> 
> I am quite puzzled. Can someone help me about that ?

Hum... I have sqlobject 0.9.1 and when I run the update script, I get 
this warning:

/usr/lib/python2.5/site-packages/sqlobject/main.py:647: 
DeprecationWarning: Use of this attribute should be replaced with 
.sqlmeta.addColumn
   '.sqlmeta.%s' % self.name, level=self.deprecation_level)

Indeed, replacing Project.addColumn with Project.sqlmeta.addColumn (and 
same thing for Task) fixes the warning and probably fixes your problem.

Aurélien



Plus d'informations sur la liste de diffusion Ml-yokadi