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

Develop #743

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

Develop #743

wants to merge 9 commits into from

Conversation

frezworx
Copy link

No description provided.

Updated the `USE_TZ` setting to `True` in `settings.py` to enable time zone support. This ensures consistent handling of datetime data across the application. Additionally, a new `db.sqlite3` file was generated.
Implemented `OrderViewSet` and `TicketViewSet` with pagination for orders. Updated serializers to handle detailed ticket and movie session data. Registered routes for orders and tickets in the URL configuration.
Enhanced `MovieViewSet` with filters for actors, title, and genres in `get_queryset`. Updated `OrderViewSet` to handle order creation with tickets using a new `OrderCreateSerializer` and `TicketCreateSerializer`. Refactored queryset and serializer selection for better functionality.
Enhanced movie filtering to use `Q` objects for better query flexibility and accuracy. Updated the actor serialization to include a `full_name` field and replaced `SlugRelatedField` with `ActorSerializer` for more detailed actor representation.
Updated `get_queryset` to allow filtering by show_time date and associated movie. Introduced truncation of show_time with `TruncDate` for precise date-based filtering. The changes enhance query flexibility and usability for the MovieSession API.
Added annotations in the view to calculate available tickets and included a serializer for taken seats. Updated the MovieSessionDetailSerializer to expose taken seats and the number of tickets available, improving API responses for detailed session data.
Previously, only a specific SQLite database file was ignored. This update generalizes the rule to ignore all files with a `.sqlite3` extension, ensuring better coverage and preventing accidental commits of database files.
Reformatted imports in `urls.py` and `views.py` for readability and consistency. Simplified the `tickets_available` annotation logic in `views.py` by removing unnecessary use of `ExpressionWrapper`. These changes improve code clarity and maintainability.
Added related_name to ForeignKey fields in MovieSession model for simplifying relationships. Introduced distinct serializers for create, list, and detail views across various entities, enhancing separation of concerns. Optimized querysets and filtering logic in views for improved performance and clarity.
Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the core functionalities of the cinema application! 🎉 While there are a few minor issues, such as redundant imports and a debug print statement, they don't significantly impact the functionality. Make sure to address these in future updates for cleaner code. Keep up the good work! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

"movie",
"cinema_hall",
"movie_title",
"cinema_hall",

Choose a reason for hiding this comment

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

The fields attribute in MovieSessionDetailSerializer contains a duplicate entry for cinema_hall. This redundancy should be removed to ensure the serializer fields are unique and correctly defined.

genres = self.request.query_params.get("genres")
if genres:
genres_list = genres.split(",")
print("Genres list:", genres_list)

Choose a reason for hiding this comment

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

Remove the debug print statement. Debugging code should not be present in production code as it can lead to unnecessary console output.

Comment on lines +102 to +103
from django.db.models import F, Count
from django.db.models.functions import TruncDate

Choose a reason for hiding this comment

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

The imports for F, Count, and TruncDate are duplicated. Remove these redundant imports to clean up the code.

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.

2 participants