summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Bean <ralph.bean@gmail.com>2011-04-12 23:57:06 -0400
committerRalph Bean <ralph.bean@gmail.com>2011-04-12 23:57:06 -0400
commit97311799197c42a6df3b968c55d2c2f274de5ae4 (patch)
tree8e57b245027f9ed1a90420eef99415e3e8aa41e6
parent1a96cb5f5d0b4f6c6681fc0c636cac39ef23ff10 (diff)
downloadleafymiracle-97311799197c42a6df3b968c55d2c2f274de5ae4.zip
leafymiracle-97311799197c42a6df3b968c55d2c2f274de5ae4.tar.gz
leafymiracle-97311799197c42a6df3b968c55d2c2f274de5ae4.tar.xz
Dependants backref
-rw-r--r--leafymiracle/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/leafymiracle/models.py b/leafymiracle/models.py
index 9f0575b..540f635 100644
--- a/leafymiracle/models.py
+++ b/leafymiracle/models.py
@@ -15,7 +15,7 @@
from sqlalchemy import Integer, Column, Unicode, UnicodeText, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
-from sqlalchemy.orm import relationship, scoped_session, sessionmaker
+from sqlalchemy.orm import relationship, scoped_session, sessionmaker, backref
from kitchen.text.converters import to_unicode
@@ -131,6 +131,7 @@ Package.__mapper__.add_property('dependencies', relationship(
primaryjoin=Package.id==dependencies_mapping.c.dependee_id,
secondaryjoin=dependencies_mapping.c.depender_id==Package.id,
secondary=dependencies_mapping,
+ backref=backref('dependants'),
doc="List of this packages' dependencies!",
))