-
Notifications
You must be signed in to change notification settings - Fork 834
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
base: master
Are you sure you want to change the base?
Solution #415
Conversation
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.
good job
model = Car | ||
fields = "__all__" | ||
success_url = reverse_lazy("taxi:car-list") | ||
template_name = "taxi/united_form.html" |
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.
do we really need template_name , fix it all over the code
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.
Yes, because I have different template. For example, here is a template that used in both forms.
taxi/views.py
Outdated
def get_context_data(self, **kwargs) -> dict: | ||
context = super().get_context_data(**kwargs) | ||
context["object_name"] = "car" | ||
return context |
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.
what is the purpose of rewriting get_context_data
?
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.
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"> |
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.
it will be a good option for the user to cancel deletion, that’s why we have an extra step before deleting something
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.
Added cancel button
No description provided.