def family_command(self, menuitem, action): print action families = [x[0] for x in self.pages['families'].get_selected_data()] if action == 'drop': clause = Eq('profile', self.current.profile) & In( 'family', families) self.pfamily.delete(clause=clause)
def __init__(self, conn, machines=None): Element.__init__(self, 'machines') self.conn = conn self.cursor = StatementCursor(self.conn) self.machines = [] if machines is None: machines = self.cursor.select(table='machines', order='machine') else: clause = In('machine', machines) machines = self.cursor.select(table='machines', clause=clause, order='machine') for m in machines: machine_element = MachineElement(m.machine, m.machine_type, m.kernel, m.profile, m.filesystem) self.machines.append(machine_element) self.appendChild(machine_element)