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

implement py-tickets-orders #665

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

Conversation

Maksym-Turenko
Copy link

No description provided.

order=order, **ticket_data
) for ticket_data in tickets_data
)
return order

Choose a reason for hiding this comment

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

In create/update/delete function you don't need to return anything

Comment on lines 134 to 136
Ticket(
order=order, **ticket_data
) for ticket_data in tickets_data

Choose a reason for hiding this comment

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

moving this brackets looks weird

cinema/views.py Outdated

if actors:
queryset = queryset.filter(
actors__id__in=actors.split(",")

Choose a reason for hiding this comment

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

Seems you need to convert it to int

fields = ("id", "order", "row", "seat", "movie_session")


class OrderSerializer(serializers.ModelSerializer):

Choose a reason for hiding this comment

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

Double check the requirements - you need to have different Serializers for POST and GET methods.

cinema/views.py Outdated
return MovieSessionSerializer


class OrderSetPagination(PageNumberPagination):

Choose a reason for hiding this comment

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

better structure if you put pagination in separate file

queryset = Order.objects.all()
serializer_class = OrderSerializer
pagination_class = OrderSetPagination

Choose a reason for hiding this comment

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

get_serializer_class will need to be implemented here after you add another OrderSerializer

db.sqlite3 Outdated

Choose a reason for hiding this comment

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

remove database from remote


if self.action == "list":
queryset = queryset.prefetch_related(
"tickets__movie_session__movie",

Choose a reason for hiding this comment

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

you will need to prefetch on detail action as well

Copy link

@oliasymak24 oliasymak24 left a comment

Choose a reason for hiding this comment

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

you need to learn how to delete unnecessary files from git)

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