millad90s / webDict

This is just a learning purpose project.
0 stars 0 forks source link

Design and Implementation of Database Fields/App for the "Pool" Django Application #18

Closed millad90s closed 1 year ago

millad90s commented 1 year ago

Description: We need to design and implement the necessary database fields for the "Pool" Django application. The application should allow an admin user to create polls/questions with multiple options and specify the start and end dates for the poll's validity.

Key Requirements:

Database Design:

Admin Functionality:

User Functionality:

Additional Information:

┆Issue is synchronized with this Trello card by Unito

millad90s commented 1 year ago

with a question and multiple radio buttons as options

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 To make a table of questions, I had a question: 1- What is meant by “option” field? You wrote this in the design database: Database Design: Include fields for the poll/question text, options, start date, and end date. 2- Should I define an ID field that is a foreign key? And it looks like this?: theory = models.ForeignKey(Theory, on_delete=models.CASCADE)

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 I noticed the option field, which is for the options of a survey, and if the options are supposed to be in the form of radio buttons, then how many options should I consider?

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 What is the username and password of the admin panel?

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 Solved

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 I wrote the task. But I haven't added the shamsi date yet. Shall I search? Or do you have a suggestion?

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 Do you think I should put the start date field of the survey automatically in the question table? And I have to leave the expiration date to the admin. And if this is true, then I have to control it. How do you think I can control it? Because its date must be later than the start date. And what will happen when it reaches the expiration date? Is that question automatically disabled from the table? Or do I have to write a piece of code for it myself?

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

I found solution. I add following code to my html file: {% if item.start\date <= item.end\date %}

Do you think this is a good solution?

sync-by-unito[bot] commented 1 year ago

➤ imilad commented:

alimoayer thanks, we will discuss about it in the meeting soon.

sync-by-unito[bot] commented 1 year ago

➤ imilad commented:

have a deep look at: https://docs.djangoproject.com/en/4.2/topics/db/models/ ( https://docs.djangoproject.com/en/4.2/topics/db/models/ )

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 ‌ok

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 In the ISS-118 branch and in the mbk directory, there is a migrations directory, if you put it in the .gitignore file like this: mbk/migrations/_\pycache\/ But now that I looked carefully, I saw that you should have put it like this: firstapp/mbk/migrations/\pycache\_/ Do you think I'm right?

sync-by-unito[bot] commented 1 year ago

➤ imilad commented:

alimoayer yes correct, you should only add pycache path.

sync-by-unito[bot] commented 1 year ago

➤ ali moayer commented:

milad715 I pushed again after the corrections

sync-by-unito[bot] commented 1 year ago

➤ imilad commented:

alimoayer sepehrrahimi

sync-by-unito[bot] commented 1 year ago

➤ Sepehr Rahimi commented:

milad715 I saw the changes and the html file is all good I should just merge it with my code

millad90s commented 1 year ago

Fixed