[mod_python] attention bakers: UI mockups posted]

Byron Ellacott bje at apnic.net
Thu Sep 16 09:42:07 EDT 2004

Chris Curvey wrote:
> My UI guy got swamped and couldn't help us out, so I just grabbed a 
> basic design from oswd.com and did it myself.  You can find the mockups 
> at http://www.chriscurvey.com/mpbo/examples.zip.  I'm not a UI designer, 
> so I've tried to keep this very basic.

If you're not interested in writing your own database layer, I've
created a simple wrapper around PySQLite that you can use:


The dblite.py module defines three classes, Project, User and Timecard.
  All classes have the methods fetch, delete, update and search defined,
with docstrings.  The back end is a pysqlite database, with location
defined by a constant at the top of the file, currently
'/tmp/bakeoff.db'.  The included schema.txt file will create the bakeoff
database and insert some sample data for users and projects.

The tables I've chosen correspond to the three classes, with Project
having a name, an optional manager and a mandatory end date, primary key
name.  User is name, optional manager, password, isadmin flag, primary
key name.  Timecard is user, date, project, hours, primary key (user,
date, project).

Quick sample usage:

user = dblite.User()
user.fetch(name = 'Dilbert')
timecard = dblite.Timecard()
for tc in timecard.search('user = %s', [user.name], 'date'):
     print tc.date, tc.project, tc.hours

Also available is an XHTML-compliant version of the templates:


Note that the code I'm using for the DB layer isn't real crash hot.
It'll do the job, but I suggest you think twice before using it in real
projects. :)


More information about the Mod_python mailing list