pyzzle :: DB :: DB :: Class DB
[hide private]
[frames] | no frames]

Class DB

source code

Represents an SQLite database used to store data for Pyzzle games.

This class performs higher level functionality than classes within the sqlite3 module. It also acts as an Adapter Class that may allow other file formats to be implemented in the future.

Instance Methods [hide private]
 
__init__(self, file=':memory:') source code
 
load(self, TableClass, tablename=None, idcolumn='id')
Loads all instances a Table class from rows in pyzzle.datafile.
source code
 
save(self, TableClass, tablename=None, idcolumn='id')
Saves all members of a Table class to pyzzle.datafile.
source code
 
close(self) source code
Method Details [hide private]

load(self, TableClass, tablename=None, idcolumn='id')

source code 

Loads all instances a Table class from rows in pyzzle.datafile.

Parameters:
  • TableClass - A class that uses the Table metaclass.
  • tablename - The name of the table in the database. If not specified, the name of TableClass is used instead.
  • idcolumn - The name of the primary key column for the table.