Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

PR solution #1

wants to merge 1 commit into from

Conversation

andrsj
Copy link
Owner

@andrsj andrsj commented Jan 12, 2023

No description provided.

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Owner Author

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

Copy link
Owner Author

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()
Copy link
Owner Author

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

Copy link
Owner Author

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>
Copy link
Owner Author

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>
Copy link
Owner Author

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
Copy link
Owner Author

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'),
Copy link
Owner Author

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
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants