CoincDefTable

class igwn_ligolw.lsctables.CoincDefTable(attrs=None)

Bases: Table

Attributes Summary

Methods Summary

get_coinc_def_id(search, search_coinc_type)

Return the coinc_def_id for the row in the table whose search string and search_coinc_type integer have the values given.

Attributes Documentation

constraints = 'PRIMARY KEY (coinc_def_id)'
how_to_index = {'cd_ssct_index': ('search', 'search_coinc_type')}
next_id = 0
tableName = 'coinc_definer'
validcolumns = {'coinc_def_id': 'int_8s', 'description': 'lstring', 'search': 'lstring', 'search_coinc_type': 'int_4u'}

Methods Documentation

get_coinc_def_id(search, search_coinc_type, create_new=True, description=None)

Return the coinc_def_id for the row in the table whose search string and search_coinc_type integer have the values given. If a matching row is not found, the default behaviour is to create a new row and return the ID assigned to the new row. If, instead, create_new is False then KeyError is raised when a matching row is not found. The optional description parameter can be used to set the description string assigned to the new row if one is created, otherwise the new row is left with no description.