From 255d9307fd1495b363bd4038fad5255ce95b7f20 Mon Sep 17 00:00:00 2001 From: Rebecca Hankey Date: Tue, 13 May 2025 17:20:36 -0400 Subject: [PATCH] In the first session of working I planned my work, I will scan these and save them to the folder for project. Then I started with the model, since it seemed easier to start with the process THEN work into the visual representation of the app. Recently my struggle and my success are related as I struggled with banjo. It has not been working on my device so I was concered I would not be able to make the app. However, similarly to the patch that you offered me for the Sub Rosa lab, I decided to use the Riddles Server and app to model my own local app. I have actually learned a lot from the troubleshooting of this process. I also have, odd as it may seem, gained a lot of confidence with trial and error in the terminal. At the beginning I was scared to try and fix problems for fear that I would do damage that I could not undo. But as I an working through this semester, it feels more like a puzzle that I can test and retest my way through rather than being scared of it. --- project/app/models.py | 19 +++++++++++++++++++ project/app/views.py | 0 2 files changed, 19 insertions(+) create mode 100644 project/app/models.py create mode 100644 project/app/views.py diff --git a/project/app/models.py b/project/app/models.py new file mode 100644 index 0000000..a409203 --- /dev/null +++ b/project/app/models.py @@ -0,0 +1,19 @@ + + +import random + +class Roster: + """Needs a roster, place to load it from, a file locater for the + list, and ability to adjust roster""" + + def __init__(self): + self.students = [] + + def load_from_list(self, names): + self.students = names + + def get_random_student(self): + if not self.students: + return None + return random.choice(self.students) + diff --git a/project/app/views.py b/project/app/views.py new file mode 100644 index 0000000..e69de29