On May 17, 2012, at 6:58 PM, Ignas Mikalajunas wrote:

> Small issues so far:
> 
> I can't set neither polymorphic_on

set this using a string - polymorphic_on = 'type'.


> nor sort_on columns in mapper

order_by?   OK, I'm not a huge fan of mapper order_by but we can come up with 
something on that....

> properties without defining columns explicitly and that overrides the
> reflected columns.
> 
> There is no way to ignore just SAWarnings just on some tables now,
> only either turn them off for all tables (around prepare call) or
> reflect the tables explicitly before calling prepare. (otherwise I
> keep getting the warnings for indexes/columns sqlalchemy does not
> understand)

you can silence warnings using the warnings filter in Python.    There's lots 
of things SQLA doesn't know how to reflect in PG, particularly functional 
indexes, so the options are it ignores them silently, raises an error, or 
warns+ignores.


> 
> the third one required a patch to the prepare method:
> 
>      @classmethod
>      def prepare(cls, engine):
>          """Reflect all :class:`.Table` objects for all current
>          :class:`.DeferredReflection` subclasses"""
>          to_map = [m for m in _MapperConfig.configs.values()
>                      if issubclass(m.cls, cls)]
>          for thingy in to_map:
>              cls.__prepare__(thingy.args, engine)
> +
> +         for thingy in to_map:
>              thingy.map()
> 
> 
> so that all the tables would get defined before models. I can't come
> up with an sqlite based testcase at the moment.
> Without this some I was having some_table has no column id errors.

Dependencies between mapper tables come up at mapper creation time only with 
joined inheritance - these mappers should already be created in the same order. 
  Dependencies between mappers due to relationship() don't attempt to resolve 
at this stage, so that wouldn't be the issue either.    A dependency due to 
column_property() with some related table, maybe, but that requires explicit 
access to the tables anyway.

A stack trace here would be extremely helpful.




-- 
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