Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add to ProgrammaticRelationProperty the knowledge about the relation …

…field (ForeignKey like concept) to let sprox know the related field
  • Loading branch information...
commit 1dda3cfbe56f6b00a559433fe529d91f889cead8 1 parent ca00844
Alessandro Molina amol- authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 tgming/properties.py
5 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)
Please sign in to comment.
Something went wrong with that request. Please try again.