-
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 #409
base: master
Are you sure you want to change the base?
Solution #409
Conversation
denys-source
commented
Sep 25, 2023
def get_context_data(self, **kwargs: Any) -> dict[str, Any]: | ||
context = super().get_context_data(**kwargs) | ||
context["car_list"] = self.object.cars.select_related("manufacturer") | ||
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.
For what purpose did you use this method instead of queryset optimization
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.
taxi/views.py
Outdated
@@ -94,15 +91,13 @@ class ManufacturerCreateView(LoginRequiredMixin, CreateView): | |||
model = Manufacturer | |||
fields = "__all__" | |||
success_url = reverse_lazy("taxi:manufacturer-list") | |||
template_name = "taxi/manufacturer_form.html" | |||
context_object_name = "manufacturer" |
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.
context_object name is also redundant attribute