Hi everyone ,

I have the following setup (snipped):

in_table = Table('in', metadata,
                  Column('id', Integer, primary_key=True),
                  Column('pA', String(6), ForeignKey('p.id'),
nullable=False),
                  Column('pB', String(6), ForeignKey('p.id'),
nullable=False),
                  Column('evidence', Integer, ForeignKey('documents.id'),
nullable=False)
                  )
mapper(Paper, document_table, properties={'authors':relation(Author,
secondary=papers_to_authors_table, backref='publications')})
mapper(Author, authors_table)
mapper(Ent, p_table)
mapper(Cooccurrence, in_table, properties={ 'evidence':relation(Paper) })

I can't seem to get the last mapper to work and I get the following
exception:

  raise exceptions.ArgumentError("WARNING: column '%s' not being added due
to property '%s'.  Specify 'allow_column_override=True' to mapper() to
ignore this condition." % (column.key, repr(prop)))
sqlalchemy.exceptions.ArgumentError: WARNING: column 'evidence' not being
added due to property '<sqlalchemy.orm.properties.PropertyLoader object at
0x2aa171b6d0>'.  Specify 'allow_column_override=True' to mapper() to ignore
this condition.

So I try to use the allow_column_override but it doesnt work and I just get
a new error:

    raise exceptions.UnmappedColumnError("Can't execute sync rule for
destination column '%s'; mapper '%s' does not map this column.  Try using an
explicit `foreign_keys` collection which does not include this column (or
use a viewonly=True relation)." % (dest_column, source_mapper))
sqlalchemy.exceptions.UnmappedColumnError: Can't execute sync rule for
destination column 'ppi.evidence'; mapper 'Mapper|Paper|documents' does not
map this column.  Try using an explicit `foreign_keys` collection which does
not include this column (or use a viewonly=True relation).

Any help greatly appreciated,
Many thanks in advance,

Nathan

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