Designing an Application

lexberezhny lexberezhny at email.msn.com
Tue May 2 21:56:52 EDT 2000


Hi,
  I am not sure if this is appropriate to this list but I though I would try
anyway. I am writing a Grade book program using a gadfly database, and a
PyGTK front end. I split everything up into a database library (all the SQL
stuff, and database initialization), grade book library (class definitions
for a student, assignment, etc), and an interface.py GTK file. Here is an
stripped down student class:

class Student:
    def __init__(self, studentID):
        student = database.getStudent(studentID) # runs the SQL query and
returns a student list
        self.Name = student[0]
        self.Grade = student[1]
        etc...

My future goal would be to allow the teacher to add his or her own
properties to a student, and maybe even add independent object (ie a teacher
wants to keep track of the favorite animals of each student, so there would
be an object for an animal maybe, and a property in the student table to
relate to the animal table, something to that effect, etc..) Well I can not
think of a good way to implement this without putting a few hacks together.
I guess what I'm trying to do is create dynamic classes? Or is there some
other way to do this? Any suggestions or experience tips would be greatly
appreciated. On a side note I am doing this for a school project, so I'm
learning as I'm going along and willing to read any documentation, etc.

 - Lex Berezhny







More information about the Python-list mailing list