On Oct 12, 2007, at 10:49 AM, Anton V. Belyaev wrote:

>
> Hello,
> Please consider the sample from SA 0.3 documentation:
>
> mapper(User, users_table, properties={
>     'boston_addresses' : relation(Address, primaryjoin=
>                 and_(users_table.c.user_id==Address.c.user_id,
>                 Addresses.c.city=='Boston'))
> })
>
> Is there any way to use a function instead of fixed parameter? To be
> able to write something like this:
>
> mapper(User, users_table, properties={
>     'featuring_addresses' : relation(Address, primaryjoin=
>                 and_(users_table.c.user_id==Address.c.user_id,
>                 Addresses.c.city==featuring_city_name))
> })
>
> where featuring_city_name is a function.
>

it can possibly work in a limited fashion if you apply viewonly=True  
to the relation().  im not sure if it would work for full read/write,  
and also id try it in 0.4.  we have a trac ticket for a simlar  
feature (supporting relationships with CAST inside of them) so im not  
sure if this falls under the same realm.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to