Skip to content

Commit 5ca9194

Browse files
committed
Change id to ID
1 parent 6f140c9 commit 5ca9194

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class User(db.Model):
3030

3131
id: int = db.Column(
3232
db.Integer, primary_key=True, unique=True, nullable=False
33-
) # user id
33+
) # user ID
3434
username: str = db.Column(
3535
db.String(80), unique=True, nullable=False) # username
3636
xp: float = db.Column(
@@ -108,7 +108,7 @@ class Task(db.Model):
108108

109109
id: int = db.Column(
110110
db.Integer, primary_key=True, unique=True, nullable=False
111-
) # task id
111+
) # task ID
112112
name: str = db.Column(db.String(80), nullable=False) # task name
113113
original_due_date: date = db.Column(
114114
db.Date,
@@ -145,7 +145,7 @@ class Task(db.Model):
145145
) # is task completed
146146
user_id: int = db.Column(
147147
db.Integer, db.ForeignKey(User.__tablename__ + ".id")
148-
) # user id
148+
) # user ID
149149
user: Mapped["User"] = db.relationship(
150150
"User", backref=db.backref("tasks", lazy=True)
151151
) # user relationship
@@ -246,12 +246,12 @@ def add_task() -> Response: # add the task to the task list
246246

247247

248248
@app.route("/complete_task/<int:task_id>")
249-
def complete_task(task_id) -> Response: # complete task from task id
249+
def complete_task(task_id) -> Response: # complete task from task ID
250250
"""
251251
Complete the task with the given task ID.
252252
task_id - the ID of the task to complete.
253253
"""
254-
task: Union[Task, None] = Task.query.get(task_id) # get task by task id
254+
task: Union[Task, None] = Task.query.get(task_id) # get task by task ID
255255
if task is not None: # if task exists
256256
due_multiplier: float = 1.0 # set default due multiplier to 1
257257
if task.repeat_often == 5: # if the task is a one-time task
@@ -373,7 +373,7 @@ def complete_task(task_id) -> Response: # complete task from task id
373373
user.combo_multiplier = 0 # reset combo multiplier to 0
374374
user.last_task_completed = (
375375
task.id
376-
) # set user last task completed to task id
376+
) # set user last task completed to task ID
377377
user.add_xp(
378378
round(
379379
task.priority
@@ -397,12 +397,12 @@ def complete_task(task_id) -> Response: # complete task from task id
397397

398398

399399
@app.route("/delete_task/<int:task_id>")
400-
def delete_task(task_id) -> Response: # delete task from task id
400+
def delete_task(task_id) -> Response: # delete task from task ID
401401
"""
402402
Delete the task based on the task ID.
403403
task_id - the ID of the task to delete.
404404
"""
405-
task: Union[Task, None] = Task.query.get(task_id) # get task by task id
405+
task: Union[Task, None] = Task.query.get(task_id) # get task by task ID
406406
if task is not None: # if task exists
407407
db.session.delete(task) # delete task from task list
408408
db.session.commit() # commit database changes

0 commit comments

Comments
 (0)