def list(self): tunnel_dicts = [] for tunnel in Tunnel.select(): tunnel_dict = self.get(tunnel.id) tunnel_dicts.append(tunnel_dict) return tunnel_dicts
def clear(self): for tunnel in Tunnel.select(): self.remove(tunnel.id)