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

Amirsalar hosseini & Arwin jafari #5

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

Amirsalar-Hosseini
Copy link

updated by ME and @ArvinNotDev

for this request we create two apps(appointment and medicine) and complete their models

@mikeesierrah
Copy link

Since you have already committed i recommend you remove .idea directory since its just a part of pycharm not the project
I also recommend you changing the .gitignore configuration to ignore whole .idea directory

class Service(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
duration = models.DurationField()
Copy link
Collaborator

Choose a reason for hiding this comment

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

durationfield gets value in a timedelta fomat not minute

Copy link
Author

Choose a reason for hiding this comment

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

The purpose of creating the duration field is to determine a specified time for the end of a task. If I used the integer field, I would have to set a series of configurations for this field, but this field uses the timedelta method and it is the best in terms of optimization. The input of this field is in the format of time, and if it is entered as a single number, it will be converted into seconds!

Copy link
Collaborator

Choose a reason for hiding this comment

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

having docstring and str method is best practice

Copy link
Author

Choose a reason for hiding this comment

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

Thank you very much for your suggestions

Copy link
Author

Choose a reason for hiding this comment

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

Currently, the purpose of writing the str method is to display the clear specifications of an instance in the management panel, and instead I used the decorator and management classes to tabulate its specifications in the management file. In Django, thanks to the overriding feature, we can avoid writing this method as much as possible, which I think helps to write clean 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.

4 participants