From bdc1e185f012a4c20b9942cb1c527b8356f40773 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Sat, 22 Jan 2011 23:58:38 +0100 Subject: [PATCH] Improve queries in dbconn.py using with_parent(). Signed-off-by: Torsten Werner --- daklib/dbconn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 30aa7aaa..83da5e9d 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2501,8 +2501,7 @@ class Suite(object): @return: list of Architecture objects for the given name (may be empty) """ - q = object_session(self).query(Architecture). \ - filter(Architecture.suites.contains(self)) + q = object_session(self).query(Architecture).with_parent(self) if skipsrc: q = q.filter(Architecture.arch_string != 'source') if skipall: @@ -2525,7 +2524,7 @@ class Suite(object): session = object_session(self) return session.query(DBSource).filter_by(source = source). \ - filter(DBSource.suites.contains(self)) + with_parent(self) __all__.append('Suite') -- 2.39.5