on a backref() if it's a string.
explicitly. Allows mixins to be used with joined table
inheritance.
+ - Declarative will properly interpret the "foreign_keys" argument
+ on a backref() if it's a string.
+
0.5.2
======
setattr(prop, attr, resolve_arg(v))
if prop.backref:
- for attr in ('primaryjoin', 'secondaryjoin', 'secondary', '_foreign_keys', 'remote_side', 'order_by'):
+ for attr in ('primaryjoin', 'secondaryjoin', 'secondary', 'foreign_keys', 'remote_side', 'order_by'):
if attr in prop.backref.kwargs and isinstance(prop.backref.kwargs[attr], basestring):
prop.backref.kwargs[attr] = resolve_arg(prop.backref.kwargs[attr])
id = Column(Integer, primary_key=True)
name = Column(String(50))
addresses = relation("Address", order_by="desc(Address.email)",
- primaryjoin="User.id==Address.user_id", foreign_keys="[Address.user_id]")
+ primaryjoin="User.id==Address.user_id", foreign_keys="[Address.user_id]",
+ backref=backref('user', primaryjoin="User.id==Address.user_id", foreign_keys="[Address.user_id]")
+ )
class Address(Base, ComparableEntity):
__tablename__ = 'addresses'