-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR solution #1
base: main
Are you sure you want to change the base?
PR solution #1
Conversation
@@ -0,0 +1,17 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.idea
folder needs to be skipped by .gitignore
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.sqlite3
- it's a binary file. Usually it's ignored
class Task(models.Model): | ||
content = models.CharField(blank=True, max_length=15) | ||
created_at = models.DateTimeField(auto_now_add=True) | ||
deadline = models.DateTimeField() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Task - todo list is consist of tasks. Each task should have fields for:
optional deadline datetime if a task should be done until some datetime
https://docs.djangoproject.com/en/4.1/ref/models/fields/#blank
https://docs.djangoproject.com/en/4.1/ref/models/fields/#null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds: for models, you want the keyword args blank=True (for the admin) and null=True (for the database).
<td>{{ tag.name }}</td> | ||
<td> | ||
<button style="background: gray" class="btn"><a role="button" style="color: white" | ||
href="{% url 'todo:task_change_status' pk=tag.id %}">Update</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong href for updating tags
</td> | ||
<td> | ||
<button style="background: gray" class="btn"><a role="button" style="color: white" | ||
href="{% url 'todo:task_change_status' pk=tag.id %}">Delete</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong href for deleting tags
@@ -0,0 +1,22 @@ | |||
from django import forms | |||
from django.core.exceptions import ValidationError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import
path("tags/<int:pk>/update", TagUpdateView.as_view(), name="tag-update"), | ||
path("tags/<int:pk>/delete", TagDeleteView.as_view(), name="tag-delete"), | ||
|
||
path('chng_st/<int:pk>', TaskChangeStatusView.as_view(), name='task_change_status'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too long string [more than 80 characters] - needs to be splitted
@@ -0,0 +1,75 @@ | |||
from django.shortcuts import get_object_or_404, redirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_object_or_404
is unused
No description provided.