On Apr 23, 2007, at 1:23 PM, Andreas Jung wrote:

> I have a view arbeitsmittelhierarchy_arbeitsmittle_view which is  
> defined
> as a left join of two tables. Trying to generate a mapper from the  
> autoload view as Table() fails:
>
>  File "build/bdist.linux-i686/egg/sqlalchemy/orm/session.py", line  
> 277, in query
>  File "build/bdist.linux-i686/egg/sqlalchemy/orm/mapper.py", line  
> 1838, in class_mapper
>  File "build/bdist.linux-i686/egg/sqlalchemy/orm/mapper.py", line  
> 321, in compile
>  File "build/bdist.linux-i686/egg/sqlalchemy/orm/mapper.py", line  
> 336, in _compile_all
>  File "build/bdist.linux-i686/egg/sqlalchemy/orm/mapper.py", line  
> 363, in _do_compile
>  File "build/bdist.linux-i686/egg/sqlalchemy/orm/mapper.py", line  
> 518, in _compile_tables
> sqlalchemy.exceptions.ArgumentError: Could not assemble any primary  
> key columns for mapped table  
> 'arbeitsmittelhierarchy_arbeitsmittel_view'
>
> What is the workaround to deal with such views? Creating a  
> PrimaryKeyConstraint for the view?
>
> Andreas

specify primary_key=[cols] to your mapper().

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to