diff options
Diffstat (limited to 'lib/sqlalchemy/ext/hybrid.py')
-rw-r--r-- | lib/sqlalchemy/ext/hybrid.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/sqlalchemy/ext/hybrid.py b/lib/sqlalchemy/ext/hybrid.py index 5bb158413..b49949071 100644 --- a/lib/sqlalchemy/ext/hybrid.py +++ b/lib/sqlalchemy/ext/hybrid.py @@ -42,25 +42,10 @@ or as the class itself:: @hybrid.method def intersects(self, other): - return (self.start < other.end) & (self.end > other.start) + return self.contains(other.start) | self.contains(other.end) - mapper(Interval1, interval_table1) - session = sessionmaker(engine)() - - session.add_all( - [Interval1(1,4), Interval1(3,15), Interval1(11,16)] - ) - intervals = - - for interval in intervals: - session.add(interval) - session.add(Interval2(interval.start, interval.length)) - - session.commit() - - ### TODO ADD EXAMPLES HERE AND STUFF THIS ISN'T FINISHED ### - + """ from sqlalchemy import util from sqlalchemy.orm import attributes, interfaces |