From: Torsten Werner Date: Sat, 22 Jan 2011 22:58:38 +0000 (+0100) Subject: Improve queries in dbconn.py using with_parent(). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdc1e185f012a4c20b9942cb1c527b8356f40773;p=dak Improve queries in dbconn.py using with_parent(). Signed-off-by: Torsten Werner --- 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')