Permalink
Browse files

Add to ProgrammaticRelationProperty the knowledge about the relation …

…field (ForeignKey like concept) to let sprox know the related field
  • Loading branch information...
1 parent ca00844 commit 1dda3cfbe56f6b00a559433fe529d91f889cead8 @amol- amol- committed Nov 18, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 tgming/properties.py
View
@@ -31,8 +31,9 @@ def __repr__(self):
class ProgrammaticRelationProperty(RelationProperty):
include_in_repr = False
- def __init__(self, related, getter, setter=None):
+ def __init__(self, related, getter, setter=None, relation_field=None):
super(ProgrammaticRelationProperty, self).__init__(related)
+ self.relation_field = relation_field
self.getter = getter
self.setter = setter
@@ -49,5 +50,5 @@ def __set__(self, instance, value):
@LazyProperty
def join(self):
- return OneToManyJoin(self.mapper.mapped_class, self.related, None)
+ return OneToManyJoin(self.mapper.mapped_class, self.related, self.relation_field)

0 comments on commit 1dda3cf

Please sign in to comment.