Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginCourse Queries Syllabus Queries 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
So I am working on a course syllabus app. Each syllabus has one or more class meeting times, a start date, an end date. I would like to be able to automatically generate a set of class meetings for each syllabus based on this information within the admin form. The idea is simply that the user should be able to input the meeting times, start date, and end date, hit a button, and have django create inline class session objects that the user can then edit. So, for instance, if I have a class that meets every Tuesday from 1 - 3 between May 1 and September 1, I should be able to hit a button, and get class sessions--or at least class session forms, there's no reason to save them in the database until they're filled in--for every Tuesday between those dates.
The relevant model code is as follows:
Generating the dates and the ClassSessions for the dates isn't the problem. Adding a button onto a custom admin template to extend change_form isn't a problem either. Because the change_form is highly generic, and does not know anything about the models it is presenting, there's no way I can see to make the button talk to the function.
So as I see it the problem is three fold: