]> git.decadent.org.uk Git - dak.git/commitdiff
Improve class Suite.
authorTorsten Werner <twerner@debian.org>
Sat, 12 Feb 2011 21:31:42 +0000 (22:31 +0100)
committerTorsten Werner <twerner@debian.org>
Sat, 12 Feb 2011 21:31:42 +0000 (22:31 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/dbconn.py
tests/dbtest_packages.py

index 1ac0c4b5de02992a83819ef8e02999369582d701..d430124ae13c7f3c4480f285f8291798558ee828 100755 (executable)
@@ -2616,7 +2616,8 @@ class Suite(ORMObject):
         self.version = version
 
     def properties(self):
-        return ['suite_name', 'version', 'sources_count', 'binaries_count']
+        return ['suite_name', 'version', 'sources_count', 'binaries_count', \
+            'overrides_count']
 
     def not_null_constraints(self):
         return ['suite_name', 'version']
@@ -3165,7 +3166,8 @@ class DBConn(object):
 
         mapper(Override, self.tbl_override,
                properties = dict(suite_id = self.tbl_override.c.suite,
-                                 suite = relation(Suite),
+                                 suite = relation(Suite, \
+                                    backref=backref('overrides', lazy='dynamic')),
                                  package = self.tbl_override.c.package,
                                  component_id = self.tbl_override.c.component,
                                  component = relation(Component, \
index 8c004cd61fba12f0fa893b618e9e00a36732a738..32c1b8c5c72a9fb3428e32c289261e860e327115 100755 (executable)
@@ -66,6 +66,8 @@ class PackageTestCase(DBDakTestCase):
         suites = get_architecture_suites('kfreebsd-i386', self.session)
         self.assertEqual(2, len(suites))
         self.assertTrue(self.suite['lenny'] not in suites)
+        # check overrides
+        self.assertEqual(0, self.suite['lenny'].overrides.count())
 
     def test_poolfiles(self):
         '''