[Z3-sqlos] creating tables from SQLOS classes
Peter Simmons
pete-lists at bcmpweb.com
Mon May 15 08:49:34 CEST 2006
Hi Brian,
I tried creating the database table from my class python console session
below. I take it the ConnectionDescriptor isn't a full blown SQLObject
connection? But a connection thing that works with Zope3 connections?
Or am I doing something wrong?
Cheers,
Pete
[GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from zope.app.debug import Debugger
>>> debugger = Debugger(db="var/Data.fs", config_file="etc/site.zcml")
>>> from tradeloyalty import Member
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: cannot import name Member
>>> from tradeloyalty.member import Member
/var/lib/zope2.9/instance/smart-trade/Products/tradeloyalty/interfaces.py:4:
DeprecationWarning: MessageIDFactory: Mutable i18n messages ("message
ids") have been deprecated in favour of immutable ones and will be
removed in Zope 3.3. Please use use zope.i18nmessageid.MessageFactory
instead.
from zope.i18nmessageid import MessageIDFactory
>>> Member.createTables()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: type object 'Member' has no attribute 'createTables'
>>> Member.sqlmeta.table
'member'
>>> Member.createTable(ifNotExists=True)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py",
line 1306, in createTable
if ifNotExists and conn.tableExists(cls.sqlmeta.table):
AttributeError: 'ConnectionDescriptor' object has no attribute 'tableExists'
>>> Member.createTable()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py",
line 1308, in createTable
conn.createTable(cls)
AttributeError: 'ConnectionDescriptor' object has no attribute 'createTable'
More information about the z3-sqlos
mailing list