Watchbill: Design History



Table of Contents


Added dates as separate objects. Added communities as rolegroups. Added on-call.

In the process, did major cleanup on gen_fake, and on the create...load process.


Now that the basics are in place, time to revisit the rqmts

Authentication Run over SSL for secure channel. Use BasicAuth with digests or FakeBasicAuth+SSL to authenticate.

Authorization Use "AuthGroup" (recursive tree), "User" (by REMOTE_USER key), and "User_Auth" (m:m for User andAuthGroup) to capture authorization

StateMemory We have available:

  • form hidden fields
  • cookies
  • mod_python "session" object
  • database session table.

For now go with hidden field for session id, and track the data in the database. Use SSL to protect from sniffing.

Dates So far date has been inferred from presence in Shift_Cell. Buit need to note it explicitly, so we can do date-specific attributes (e.g., "holiday" markings).

Multiple communities . If there are groups of roles, allow for selecting the desired group on the toc, or all. Show the role group on the views and edits.

"On call" . A person may be on call for a role even if not actually assigned to the shift cell. Of course this is a real assignment (and the person needs time away from even on-call status), so we need to indicate "on-call" vs "assigned:.

So lets update the data model.



  • Multiple days
  • Shifts have different valid roles
  • Cell therefore may be correctly empty, or empty and needs someone, or has one person, or has more than one person.
  • Main View vs Main Edit
  • Scaling. Tried 1000 people and 100 roles. No problem.


Redo fake data to force cases where no one is filled in for a cell, and to ensure that all fill-ins are valid (person_role and shift_role).

Handle cases where a shift doesn't have all the roles. Use blank cell for that in both csv and web.


Made watchbill/{htdocs|cgi-bin}. Added stanza to extra/httpd-watchbill.conf, and added "Include extra/httpd-watchbill.conf" to httpd.conf.

Setup watchbill/web/ Did send_toc, recv_toc. Used those to get templates and hookup to cfg file resolved.

Next added send_mainview and recv_mainview. Addressed:

  • Missing cells (marked in red)
  • Delete existing entry.
  • Add a new entry. Added edits checks, and then had to insert a new shift_role so I could do the shift_cell.



Created ctrl method to load csv's via vanilla insert statements, Drive it via Used that to load the fake data.


Created ctrl method for grid. Drive it via Used that to explore the main use case (who is handling what roles on what shift).

Also had created a csv file of results.

Next steps

Where possible, prep in batch, but some require interaction. Use vanilla cgi for that.

  mainview and edit
    72 hr lookahead (empty slots)
    per-person schedule
    per-role schedule
    upload person list
    upload role list
    upload shift list
    copy week forward


After survey of problem space and feedback from others, concluded

  • The problem needs an OSS solution
  • There is not already an OSS solution
  • It is tractable for a one-person project.
  • I should therefore do it.

Therefore kicked off development effort, as "watchbill" release 1.0..

Structure project

      watchbill_proj/           (project mamagement tree)
        index.pdx     (work statement, release plan, etc.)
        deshist/      (design history)
        models/       (UML models)
        models_html/  (UML publiushed to html)
        altanal/      (alternatives analysis)
        rel_001_0/    (release 1.0)

      conf/           (config files)

      watchbill/      (GNU-style, generated by mkpythonproj)
        COPYING       (LGPL)
        VERSION       (used to label tarball)

        watchbill/       (the actual package)

            ddl.sql      (db definition)
    (metadata, derived from database)
       (layer on top of database)
        (controller on top- of model)
          comline/       (one of the views)

          web/           (use in web mode)

          go_            (various go scripts)
          testdata/      (testcases and oracles)
     (create fake data)

Create DB

See watchbill_test/go_createdb

Edit pg_hba.conf:

local   watchbill   wb_admin                          md5
local   watchbill   wb_user                           md5

Given UML class model, generate generic RDBMS DDL. Run it using go_createdb.

Create test harness

Setup "go_test" toconfirm access to database.

Created "gen_fake" to create fkae data. Used that to load database, and thus to provide environment for development.

Config COntrol

Checked in to SVN


Put up website. Requested insight on issues, factors, and candidates.

Creator: Harry George
Updated/Created: 2009-07-20