On Mar 30, 2009, at 9:58 AM, Marcin Krol wrote:

>
> Michael Bayer wrote:
>>> I need to do smth like this in a mapper() call for table 'hosts':
>>>
>>> 'Earliest_reservation':relation(Reservation,  
>>> order_by=Reservation.id,
>>> backref='hosts'),
>>> 'Reservations':relation(Reservation,
>>> secondary=reservation_hosts_assoc_table, backref='hosts')
>>>
>>> That is, I need to create "links" between tables 'hosts' and
>>> 'reservation': one is normal ForeignKey of reservation.id in hosts
>>> table, and another is via association table
>>> (reservation_hosts_assoc_table).
>>
>> whats the actual question ?   the above setup should be fine.
>
> '%s': "
> sqlalchemy.exc.ArgumentError: Error creating backref 'hosts' on  
> relation
> 'Host.Reservations': property of that name exists on mapper
> 'Mapper|Reservation|reservation'


the two backrefs have to have different names.

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