-
Notifications
You must be signed in to change notification settings - Fork 693
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 #713
base: master
Are you sure you want to change the base?
Solution #713
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.
Thank you for your hard work on this project! There are a couple of critical issues that need to be addressed before we can approve the pull request:
-
Namespace Definition: Ensure that the
urls.py
files in both thecinema
anduser
apps have the correct namespaces defined (namespace="cinema"
andnamespace="user"
). This is crucial for theinclude
function to work properly with namespaces and ensure that URL routing functions as expected. -
OrderViewSet Queryset: In the
OrderViewSet
, theget_queryset
method should useself.queryset
instead of directly queryingOrder.objects
. This change will maintain consistency and allow for easier modifications in the future if the queryset needs to be altered. Please update the linereturn Order.objects.filter(user=self.request.user)
toreturn self.queryset.filter(user=self.request.user)
.
Once these changes are made, your code will be in great shape! Keep up the excellent work, and don't hesitate to reach out if you have any questions or need further assistance. 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
cinema/views.py
Outdated
def get_queryset(self): | ||
return Order.objects.filter(user=self.request.user) |
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.
The get_queryset
method should use self.queryset
instead of directly querying Order.objects
. This ensures consistency and allows for easier modifications if the queryset is changed in the future. Consider changing return Order.objects.filter(user=self.request.user)
to return self.queryset.filter(user=self.request.user)
.
@@ -4,5 +4,6 @@ | |||
urlpatterns = [ | |||
path("admin/", admin.site.urls), | |||
path("api/cinema/", include("cinema.urls", namespace="cinema")), | |||
path("api/user/", include("user.urls", namespace="user")), |
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.
Ensure that the cinema
and user
apps have urls.py
files with the correct namespaces defined (namespace="cinema"
and namespace="user"
). This is necessary for the include
function to work properly with namespaces.
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.
Great job on addressing most of the issues in your code! 🎉 Your implementation is well-structured, and you've made significant progress. However, there are a few critical areas to focus on:
-
Namespace Definition: Ensure that the
urls.py
files in both thecinema
anduser
apps have the correct namespaces defined (namespace="cinema"
andnamespace="user"
). This is crucial for theinclude
function to work properly with namespaces and ensure that URL routing functions as expected. -
OrderViewSet Queryset: In the
OrderViewSet
, theget_queryset
method should useself.queryset
instead of directly queryingOrder.objects
. Update the line toreturn self.queryset.filter(user=self.request.user)
to maintain consistency and allow for easier modifications in the future.
These adjustments are important for the functionality and maintainability of your code. Keep up the good work, and make sure to address these points in your future iterations. Your dedication to learning and improving is commendable! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
def get_queryset(self): | ||
return Order.objects.filter(user=self.request.user) | ||
return self.queryset.filter(user=self.request.user) |
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.
In the OrderViewSet
, the get_queryset
method should use self.queryset
instead of directly querying Order.objects
. Update the line to return self.queryset.filter(user=self.request.user)
to maintain consistency and allow for easier modifications in the future.
@@ -4,5 +4,6 @@ | |||
urlpatterns = [ | |||
path("admin/", admin.site.urls), | |||
path("api/cinema/", include("cinema.urls", namespace="cinema")), | |||
path("api/user/", include("user.urls", namespace="user")), |
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.
Ensure that the urls.py
files in both the cinema
and user
apps have the correct namespaces defined (namespace="cinema"
and namespace="user"
). This is crucial for the include
function to work properly with namespaces and ensure that URL routing functions as expected.
No description provided.