#!/usr/bin/python #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ # Wedding Registry module # # 12-28-96 ct7 Original version #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ import sys sys.stderr = sys.stdout print "Content-type: text/html\n" import registry import template import database #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ def cell( c ): if c : return c else: return " " #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ def query(): db = database.Database() sql = "select * from item order by item_id" rows = db[sql] print """ This Wedding Registry works just like a regular department store registry. First you check what we've registered, and once you've made your purchase, you just have to check back here and register what you've purchased.

The Registry is completely anonymous - no one will know who registered which gift. The only data that the registry stores is how many items have been registered as "purchased", not who purchased what.

Because the register is anonymous, you will need to get a password in order to register your gift. Our list of neutral registry contacts can give you the password. Please contact one of them before you try to register your gift.

This is a list of what we'd like to have. Click on a Description to mark an item as purchased:

""" for row in rows: print ( '' '' '' '' '' '' '' '' ) % ( row[2], row[0], row[3], cell(row[9]), cell(row[4]), cell(row[5]), cell(row[6]), cell(row[7]), cell(row[8]) ) print """
SectionDescription
Comments
Vendor
Pattern
ColorQty DesiredQty Listed
%s%s' '
%s
%s
%s
%s%s%s
""" #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ template.header("Wedding Register Listing") query() template.footer()