map_to() was added in 0.6.6
On Jun 12, 2011, at 11:51 PM, Reece wrote:
> Thanks, Michael.
>
> I'm getting further, but still have an error that I've not been able to
> resolve.
>
> from sqlalchemy.ext.sqlsoup import SqlSoup
> from sqlalchemy import Table
> u = SqlSoup('postgresql+psycopg2://[email protected]:5432/unison')
> t = Table("pseqalias", u._metadata, autoload=True, schema='unison')
> u.map_to('pseqalias', schema='unison', selectable=t,
> mapper_args={"primary_key":[t.c.pannotation_id]})
>
> For which I get:
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 558,
> in __getattr__
> return self.entity(attr)
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/ext/sqlsoup.py", line 547,
> in entity
> table = Table(attr, self._metadata, autoload=True,
> autoload_with=self.bind, schema=schema or self.schema)
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 209, in
> __new__
> table._init(name, metadata, *args, **kw)
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 257, in
> _init
> include_columns=include_columns)
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1866,
> in reflecttable
> self.dialect.reflecttable(conn, table, include_columns)
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line
> 228, in reflecttable
> return insp.reflecttable(table, include_columns)
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line
> 376, in reflecttable
> for col_d in self.get_columns(table_name, schema, **tblkw):
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line
> 223, in get_columns
> **kw)
> File "<string>", line 1, in <lambda>
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py",
> line 40, in cache
> ret = fn(self, con, *args, **kw)
> File
> "/usr/lib/python2.7/dist-packages/sqlalchemy/dialects/postgresql/base.py",
> line 962, in get_columns
> info_cache=kw.get('info_cache'))
> File "<string>", line 1, in <lambda>
> File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py",
> line 40, in cache
> ret = fn(self, con, *args, **kw)
> File
> "/usr/lib/python2.7/dist-packages/sqlalchemy/dialects/postgresql/base.py",
> line 876, in get_table_oid
> raise exc.NoSuchTableError(table_name)
> sqlalchemy.exc.NoSuchTableError: map_to
>
> This is SqlAlchemy 0.6.4. I'll try 0.7.1 shortly. I'd appreciate for any idea
> you have.
>
> This database makes heavy use of views. I'd be very interested in any
> suggestions you have for adding support for reflection of views.
>
> Thanks,
> Reece
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sqlalchemy/-/1zGXKGrrIhYJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.