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

Tickets and Orders solution #505

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

Conversation

Lyutillis
Copy link

No description provided.

class Ticket(models.Model):
movie_session = models.ForeignKey(MovieSession, on_delete=models.CASCADE)
order = models.ForeignKey(Order, on_delete=models.DO_NOTHING)
row = models.IntegerField()

Choose a reason for hiding this comment

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

So if order will be canceled and deleted the ticked will be remain and there will be no possibility to sell this ticket to another person

db/models.py Outdated
Comment on lines 102 to 112
class Meta:
constraints = [
models.UniqueConstraint(
fields=[
"movie_session",
"row",
"seat"
],
name="TicketUniqueConstraint"
)
]

Choose a reason for hiding this comment

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

class Meta should be placed before methods. You have this in your checklist)

manage.py Outdated
@@ -4,6 +4,7 @@


if __name__ == "__main__":
print(__package__)

Choose a reason for hiding this comment

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

remove print

services/user.py Outdated
first_name: str = None,
last_name: str = None,
) -> User:
user = User.objects.create_user(

Choose a reason for hiding this comment

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

read checklist again, please

db/models.py Outdated


class User(AbstractUser):
...

Choose a reason for hiding this comment

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

You can use regular pass

Copy link

@LiudmylaKulinchenko LiudmylaKulinchenko left a comment

Choose a reason for hiding this comment

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

Well done! 🚀

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.

3 participants