def __init__(self): idcol = AutoId('contactid', 'contact_ident') name = PkName('name') address = Num('addressid') address.set_fk('addresses', 'addressid') email = PkBigname('email') desc = Text('description') Table.__init__(self, 'contacts', [idcol, name, address, email, desc])
def AutoId(name, seqname, pk=False): column = Num(name) c = column.constraint c.unique = True c.null = False c.pk = pk column.set_auto_increment(seqname) return column
def __init__(self): ticket = Num('ticketid') ticket.set_fk('tickets') actionid = AutoId('actionid', 'action_ident', pk=True) subject = Bigname('subject') action = Name('action') author = Name('author') posted = Now('posted') data = Text('data') cols = [ticket, actionid, subject, action, author, posted, data] Table.__init__(self, 'ticketactions', cols)
def __init__(self): clientid = Num('clientid') clientid.set_fk('clients') locationid = Num('locationid') locationid.set_fk('locations', 'locationid') contactid = Num('contactid') contactid.set_fk('contacts', 'contactid') cols = [clientid, locationid, contactid] Table.__init__(self, 'clientinfo', cols)