On 5 май, 11:55, Max Ischenko <[EMAIL PROTECTED]> wrote:
> Hello,
>
> My python app uses Wordpress blog database and my sqlalchemy mappings
> recently broke due to Wordpress update. Can someone pls help to map
> the following "taxonomy" tables into SA?

I've tried to follow "Specifying Alternate Join Conditions to
relation()" recipe from the docs and got an error about invalid kwarg:

  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.5-py2.5.egg/
sqlalchemy/orm/__init__.py", line 566, in mapper
    return Mapper(class_, local_table, *args, **params)
TypeError: __init__() got an unexpected keyword argument
'foreign_keys'

Here is the offending code:

    mapper(WordpressPost, wp_posts_tbl, properties={
        'categories': relation(WordpressTaxonomy, primaryjoin=
            and_(wp_terms_taxonomy_tbl.c.taxonomy=='category',

wp_term_relationships_tbl.c.term_taxonomy_id==wp_terms_taxonomy_tbl.c.term_taxonomy_id)),
        }, foreign_keys=[wp_terms_taxonomy_tbl.c.term_taxonomy_id])


Max.

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