<s> """<STR_LIT>""" <EOL> class Column ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , column_name , column_type , encoding = None , <EOL> fk_reference = None , fk_table = None , is_distkey = False , <EOL> is_sortkey = False , is_primarykey = False , is_null = False , <EOL> is_not_null = False , position = None ) : <EOL> """<STR_LIT>""" <EOL> self . column_name = column_name <EOL> self . column_type = column_type <EOL> self . encoding = encoding <EOL> self . fk_reference = fk_reference <EOL> self . fk_table = fk_table <EOL> self . is_distkey = is_distkey <EOL> self . is_sortkey = is_sortkey <EOL> self . is_primarykey = is_primarykey <EOL> self . is_null = is_null <EOL> self . is_not_null = is_not_null <EOL> self . position = position <EOL> if is_null and is_not_null : <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> if self . is_primarykey : <EOL> self . is_not_null = True <EOL> self . is_null = False <EOL> def __str__ ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . column_type is not None : <EOL> return '<STR_LIT>' % ( self . column_name , self . column_type ) <EOL> return self . column_name <EOL> @ property <EOL> def primary ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . is_primarykey <EOL> @ primary . setter <EOL> def primary ( self , value = True ) : <EOL> """<STR_LIT>""" <EOL> self . is_primarykey = value <EOL> if self . is_primarykey : <EOL> self . is_not_null = True <EOL> self . is_null = False <EOL> @ property <EOL> def name ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . column_name </s>
