On Oct 17, 2006, at 3:26 AM, artee wrote:
>> of postgres views. > Views are one of most important thing in DB programming. > I'm surprised that this topic isn't tested in SA :( heh...i meant just the reflection of views. if you create a view in oracle and try to reflect it like a table, youll fail miserably. >> mapped table, you can use the "primary_key" argument to mapper() > I've tried to do this but some errors occur on session.query > (wlt.select pass): > Wlt.mapper = mapper(Wlt, wlt, primary_key=wlt.c.id) > items = wlt.select(w, order_by=order, limit=5).execute() # OK, 5 items > items = session.query(Wlt).select(w, order_by=order, limit=5) > -> TypeError: iteration over non-sequence > -> in > -> File "build\bdist.win32\egg\sqlalchemy\orm\mapper.py", line 398, in > _compile_tables > primary_key is an array argument... >> itself and force the columns that should be used for the pk. > There is a primary key defined - Column('id', String(), > primary_key=True) > It isn't enough ? it should be. you are probably having some problems with the overriding of primary keys during table reflection, since there was a recent bugfix that is only in the SVN trunk with regards to that. > > If you want I can sent to you full DB structure to test :) > sure. first try it with the latest SVN trunk to see if that helps. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---