Gate sub-components section on eligible devices via can_have_subcomponents()
This commit is contained in:
@@ -76,6 +76,9 @@ class Device(Base):
|
||||
def is_subcomponent(self):
|
||||
return self.parent_id is not None
|
||||
|
||||
def can_have_subcomponents(self):
|
||||
return self.parent_id is None and self.battery_slots == 0
|
||||
|
||||
def effective_installed_count(self):
|
||||
if self.has_children():
|
||||
return sum(c.installed_count() for c in self.children)
|
||||
|
||||
Reference in New Issue
Block a user