def _day_selected_cb(self, widget, data=None): '''Select new day''' date_formated = date_format(self.calendar.get_date()) db = DataBase(self.path) data = db.get(date_formated) db.close() tasks_model = TasksModel(data) self.tasks_list.set_model(tasks_model.get_model())
def get_tasks(self): '''Get the rows''' date_formated = date_format(self.calendar.get_date()) db = DataBase(self.path) data = db.get(date_formated) reminder = db.get_reminder() db.close() tasks_model = TasksModel(data) reminder_model = TasksModel(reminder) self.tasks_list.set_model(tasks_model.get_model()) self.reminder_list.set_model(reminder_model.get_model())
def _filter_query_cb(self, widget, data=None): '''Query for filter the tasks''' category = self.combobox_q_category.get_active() priority = self.combobox_q_priority.get_active() self.combobox_q_category.set_active(-1) self.combobox_q_priority.set_active(-1) date_formated = date_format(self.calendar.get_date()) data = (date_formated, category, priority) db = DataBase(self.path) tasks = db.filter_tasks(data) db.close() tasks_model = TasksModel(tasks) self.tasks_list.set_model(tasks_model.get_model())