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

Solution #915

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

Conversation

andreykolomiec
Copy link

No description provided.

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 following the checklist and ensuring your code is well-structured! 🎉 While there are a few minor improvements suggested, they don't impact the core functionality. Keep up the good work and consider the feedback for future enhancements!

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

Comment on lines +29 to +32
class Meta:
indexes = [
models.Index(fields=["title"])
]

Choose a reason for hiding this comment

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

The class Meta should be defined after all attributes of the Movie class. Currently, it is placed before the __str__ method, which is not recommended according to the checklist.

from django.db import transaction
from django.core.exceptions import ValidationError
from django.db.models import QuerySet

Choose a reason for hiding this comment

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

According to the checklist, use get_user_model() instead of User for better practice when dealing with user models.

order = Order.objects.create(user=user)
if date:
try:
order.created_at = datetime.strptime(date, "%Y-%m-%d %H:%M")

Choose a reason for hiding this comment

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

There is a typo in the error message: 'formate' should be 'format'.

else:
order.created_at = timezone.now()

order.save()

Choose a reason for hiding this comment

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

According to the checklist, avoid calling save() multiple times if possible. Consider setting all attributes before saving the order.

"db",
]

AUTH_USER_MODEL = "db.User"

Choose a reason for hiding this comment

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

The AUTH_USER_MODEL setting should use the get_user_model() function instead of directly referencing the model string. This is a best practice to ensure compatibility and flexibility in your Django project.

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