def __init__(self): troubleid = AutoId('troubleid', 'trouble_ident', pk=True) clientid = Num('clientid') clientid.set_fk('clients') problem = Name('problem') worktodo= Text('worktodo') posted = Now('posted') status = Name('status') status.set_fk('trouble_status') cols = [troubleid, clientid, problem, worktodo, posted, status] Table.__init__(self, 'troubles', cols)
def __init__(self, mach_types_table, kernels_table, profiles_table, filesystem_table): machine_col = PkName('machine') mtype_col = Name('machine_type') mtype_col.set_fk(mach_types_table) kernel_col = Name('kernel') kernel_col.set_fk(kernels_table) profile_col = Name('profile') profile_col.set_fk(profiles_table) fs_col = Name('filesystem') fs_col.set_fk(filesystem_table, 'filesystem') columns = [machine_col, mtype_col, kernel_col, profile_col, fs_col] Table.__init__(self, 'machines', columns)
def __init__(self, kernels_table, profiles_table, diskconfig_table): machine_col = PkName('machine') kernel_col = Name('kernel') kernel_col.set_fk(kernels_table) profile_col = Name('profile') profile_col.set_fk(profiles_table) diskconfig_col = Name('diskconfig') diskconfig_col.set_fk(diskconfig_table) columns = [machine_col, kernel_col, profile_col, diskconfig_col] Table.__init__(self, 'machines', columns)