def edit_notes_query(new_value, entry_id): """Update a row's ntoes column with a new value. :param new_value: string :param entry_id: entry's primary key :return: edited entry """ q = Entry.update(notes=new_value).where(Entry.id == entry_id).execute() return Entry.select().where(Entry.id == entry_id).get()
def edit_date_query(new_value, entry_id): """Update a row's date column with a new value. :param new_value: string that is date format :param entry_id: entry's primary key :return: edited entry """ q = Entry.update(date=new_value).where(Entry.id == entry_id).execute() return Entry.select().where(Entry.id == entry_id).get()
def edit_time_query(new_value, entry_id): """Update a row's time_spent column with a new value. :param new_value: int :param entry_id: entry's primary key :return: edited entry """ q = Entry.update(time_spent=new_value).where( Entry.id == entry_id).execute() return Entry.select().where(Entry.id == entry_id).get()