<s> import sqlalchemy as sa <EOL> from sqlalchemy . orm import exc <EOL> from solum . objects import parameter as abstract <EOL> from solum . objects . sqlalchemy import models as sql <EOL> class Parameter ( sql . Base , abstract . Parameter ) : <EOL> """<STR_LIT>""" <EOL> __resource__ = '<STR_LIT>' <EOL> __tablename__ = '<STR_LIT>' <EOL> __table_args__ = sql . table_args ( ) <EOL> id = sa . Column ( sa . Integer , primary_key = True , autoincrement = True ) <EOL> plan_id = sa . Column ( sa . Integer , sa . ForeignKey ( '<STR_LIT>' ) , <EOL> nullable = False ) <EOL> user_defined_params = sa . Column ( sql . YAMLEncodedDict ( <NUM_LIT> ) ) <EOL> sys_defined_params = sa . Column ( sql . YAMLEncodedDict ( <NUM_LIT> ) ) <EOL> @ classmethod <EOL> def get_by_plan_id ( cls , context , p_id ) : <EOL> try : <EOL> session = sql . SolumBase . get_session ( ) <EOL> return session . query ( cls ) . filter_by ( plan_id = p_id ) . one ( ) <EOL> except exc . NoResultFound : <EOL> return None <EOL> class ParameterList ( abstract . ParameterList ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def get_all ( cls , context ) : <EOL> return ParameterList ( sql . model_query ( context , Parameter ) ) </s>
