Closed millad90s closed 1 year ago
with a question and multiple radio buttons as options
➤ 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)
➤ 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?
➤ ali moayer commented:
milad715 What is the username and password of the admin panel?
➤ ali moayer commented:
milad715 Solved
➤ 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?
➤ 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?
➤ 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?
➤ imilad commented:
alimoayer thanks, we will discuss about it in the meeting soon.
➤ 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/ )
➤ ali moayer commented:
milad715 ok
➤ 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?
➤ imilad commented:
alimoayer yes correct, you should only add pycache path.
➤ ali moayer commented:
milad715 I pushed again after the corrections
➤ imilad commented:
alimoayer sepehrrahimi
➤ Sepehr Rahimi commented:
milad715 I saw the changes and the html file is all good I should just merge it with my code
Fixed
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:
Create a database table or model to represent the polls/questions.
Include fields for the poll/question text, options, start date, and end date.
Admin Functionality:
Implement the necessary forms and views for creating and managing polls/questions.
Ensure that the data entered by the admin is properly validated before saving it to the database.
User Functionality:
Implement the necessary views to display active polls/questions to users.
Allow users to select their preferred options and participate in active polls.
Additional Information:
┆Issue is synchronized with this Trello card by Unito