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

Solution #415

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Solution #415

wants to merge 4 commits into from

Conversation

ORENYT
Copy link

@ORENYT ORENYT commented Sep 26, 2023

No description provided.

@ORENYT
Copy link
Author

ORENYT commented Sep 26, 2023

image
image
image
image
image
image

Copy link

@OleksandrMoroz24 OleksandrMoroz24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job

model = Car
fields = "__all__"
success_url = reverse_lazy("taxi:car-list")
template_name = "taxi/united_form.html"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need template_name , fix it all over the code

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because I have different template. For example, here is a template that used in both forms.

taxi/views.py Outdated
Comment on lines 64 to 67
def get_context_data(self, **kwargs) -> dict:
context = super().get_context_data(**kwargs)
context["object_name"] = "car"
return context
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of rewriting get_context_data?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

<p><i>You can't revert this change!</i></p>
<form action="" method="post">
{% csrf_token %}
<input type="submit" value="Confirm" class="btn-danger">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be a good option for the user to cancel deletion, that’s why we have an extra step before deleting something

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added cancel button

@ORENYT ORENYT requested a review from Sofbog October 9, 2023 11:22
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.

4 participants