forked from ChrisTM/Active-Record-Example-for-a-Gradebook
-
Notifications
You must be signed in to change notification settings - Fork 0
An active record implementation for a gradebook with students, assignments, and grades. Uses Python and SQLite.
License
marcris/Active-Record-Example-for-a-Gradebook
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
To play around with the active record interface for this gradebook schema, we must first create the database. In an interactive python terminal (either "ipython model.py" or "python -i model.py"), run the following: >>> db.init_db() That will initialize the database with the schema in the file 'schema.sql' and the data in 'testdata.sql'. Now try out some of these: >>> Students.all() >>> [s.full_name for s in Student.all()] >>> Student.get(1).get_grades() >>> Assignment.get(1) >>> Assignment.where(points=20) It is a useful exercise to uncomment line 68 of model.py to enable logging and see the SQL that the program executes to fulfill these requests. This branch was forked to preserve the current state as a basis for marcris/active-record-mc.
About
An active record implementation for a gradebook with students, assignments, and grades. Uses Python and SQLite.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Python 77.8%
- PLpgSQL 22.2%