You need to add an ID column to your countries_languages table, like this:

    Column("id", Integer, primary_key=True),

Alternatively you could declare the combination country_id and language_id as 
your primary key.

Barry

----- Original Message ----
From: mmstud <[EMAIL PROTECTED]>
To: sqlalchemy <sqlalchemy@googlegroups.com>
Sent: Saturday, October 27, 2007 3:53:47 PM
Subject: [sqlalchemy] Re: associative table with extra field



That was a good tip. Now i get:

2007-10-27 22:49:25,454 INFO sqlalchemy.engine.base.Engine.0x..90 {}
2007-10-27 22:49:25,455 INFO sqlalchemy.engine.base.Engine.0x..90
COMMIT
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "fixtures.py", line 4, in ?
    from mappers import *
  File "mappers.py", line 39, in ?
    mapper(CountryLanguage, countries_languages, properties={
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/__init__.py", line
516, in mapper
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
152, in __init__
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
414, in _compile_tables
sqlalchemy.exceptions.ArgumentError: Could not assemble any primary
key columns for mapped table 'countries_languages'

I'll provide more full example tomorrow...

Thanks.

On Oct 27, 6:44 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Oct 27, 2007, at 8:02 AM, mmstud wrote:
>
>
>
> > I'm trying to implement associative table with extra field on join
> > table, but faced problems... what is it, that im doing wrong here,
> > because i get python error:
>
> try not using IPython.  shells like IDLE etc. always seem to corrupt
  
> things.  at the very least, youll get a real stack trace.








__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--~--~---------~--~----~------------~-------~--~----~
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