return NotImplemented
def properties(self):
- return ['component_name', 'component_id', 'description', 'location', \
- 'meets_dfsg']
+ return ['component_name', 'component_id', 'description', \
+ 'location_count', 'meets_dfsg', 'overrides_count']
def not_null_constraints(self):
return ['component_name']
mapper(Location, self.tbl_location,
properties = dict(location_id = self.tbl_location.c.id,
component_id = self.tbl_location.c.component,
- component = relation(Component, \
- backref=backref('location', uselist = False)),
+ component = relation(Component, backref='location'),
archive_id = self.tbl_location.c.archive,
archive = relation(Archive),
# FIXME: the 'type' column is old cruft and
suite = relation(Suite),
package = self.tbl_override.c.package,
component_id = self.tbl_override.c.component,
- component = relation(Component),
+ component = relation(Component, \
+ backref=backref('overrides', lazy='dynamic')),
priority_id = self.tbl_override.c.priority,
priority = relation(Priority, \
backref=backref('overrides', lazy='dynamic')),
def test_components(self):
'test class Component'
- self.assertEqual(self.loc['main'], self.comp['main'].location)
- self.assertEqual(self.loc['contrib'], self.comp['contrib'].location)
+ self.assertEqual([self.loc['main']], self.comp['main'].location)
+ self.assertEqual([self.loc['contrib']], self.comp['contrib'].location)
+ self.assertEqual(0, self.comp['main'].overrides.count())
def test_get_component_by_package_suite(self):
'test get_component_by_package_suite()'