Hello list  :)

I'm using SQLAlchemy in a mod_python application. I'm using the autoload=True to load the tables definition from the SQL Server (Postgresql). I like to do this way, and it works fine except that it takes a lot of time and it slow down the application the first time the handler loads (after it's cached by mod_python). I thought to "pickle" the table definition once and reuse it later (good idea ? bad idea ?), but I got an error when I call the .dump() method of cPickle :

>>> tables
<open file 'blah.dmp', mode 'w' at 0xb7b02720>
>>> type(invasives)
<class 'sqlalchemy.schema.Table'>
>>> cPickle.dump(invasives, tables, 2)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'NoneType' object is not callable
>>> cPickle.dump(invasives, tables)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.3/copy_reg.py", line 83, in _reduce_ex
  dict = getstate()
TypeError: 'NoneType' object is not callable

I suspect that __getstate__ is in a class but is not a function ...

any idea ?

thanks


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to