def find(self, widget): print "find" dialog = Dialog.FindActivityDialog() result, list = dialog.run() new_list = [] if (result == 1): for i in self.user.activities_list: if (list[0] is None or i.name == list[0]) \ and (list[1] is None or i.day == list[1]) \ and (list[2] is None or i.start >= list[2]) \ and (list[3] is None or i.end <= list[3]): new_list.append(i) self.refresh(lista=new_list)