hi there,
when I try to reflect a postges db like this:
Base2 = declarative_base(engine)
Base2.metadata.reflect()

I get a key error (see below).

however, if I define its class using autoload, things are fine
class dokstatus(Base2):
    #__table__ = tables2["dokstatus"]
    __tablename__ = 'dokstatus'
    __autoload__ = True
    __table_args__ = {'autoload_with' : engine}

there are many other tables (some 120) in the database and I do not know
which table is the culprit.
Now my questions:
    - how can I "fix" the error
    - is there a way to selectively reflect tables?

thanks
robert

File
"/home/zope/ruagaeroV2/eggs/SQLAlchemy-0.5.1-py2.4.egg/sqlalchemy/engine/base.py",
line 1265, in reflecttable
    self.dialect.reflecttable(conn, table, include_columns)
  File
"/home/zope/ruagaeroV2/eggs/SQLAlchemy-0.5.1-py2.4.egg/sqlalchemy/databases/postgres.py",
line 656, in reflecttable
    schema.Index(name, *[table.columns[c] for c in columns],
  File
"/home/zope/ruagaeroV2/eggs/SQLAlchemy-0.5.1-py2.4.egg/sqlalchemy/util.py",
line 634, in __getitem__
    return self._data[key]
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
"/home/zope/ruagaeroV2/parts/instance/etc/site.zcml", line 14.2-14.55
    ZopeXMLConfigurationError: File
"/home/zope/ruagaeroV2/parts/instance/etc/package-includes/003-ruagaero.intradevcontent-configure.zcml",
line 1.0-1.68
    KeyError: u'oid'


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to