On Thu, Feb 18, 2010 at 02:25, Anil <[email protected]> wrote:
> I have a mapped table like this:
>
> mapper(User, t_user, properties = { 'plans': relation(Plan)})
>
> Is it possible to relate the User object to a column in the Plan table with
> a column "status" set to "active"?

Not sure if its the correct way, but I'm doing that like this:

orm.mapper(Category, category_table, properties={
    'items' : orm.relation(item.Item,
            order_by = 'item.position, item.date_modified desc',
            backref = orm.backref('category', lazy='dynamic'),
            primaryjoin = sql.and_(
                item.item_table.c.category_id == category_table.c.id,
                item.item_table.c.active == True
            ),
        ),
    }
)

-- 
Atte.
Martín Marrese
--
JID: kyheo at lugmen.org.ar
MSN: martin at marrese.com.ar
GTalk: marrese at gmail.com
Skype: kyheo_ (with the _)
--
Ha estado usted razonando fuera del recipiente.
(LL)

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to