Example #1
0
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()
Example #2
0
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()
Example #3
0
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()