<s> from karesansui . lib . const import MACHINE_ATTRIBUTE <EOL> from karesansui . db . access import dbsave , dbupdate , dbdelete <EOL> from karesansui . db . model . machine2jobgroup import Machine2Jobgroup <EOL> from karesansui . db . access . _2pysilhouette import jobgroup_findbyuniqkey <EOL> def findbyall ( session ) : <EOL> return session . query ( Machine2Jobgroup ) . all ( ) <EOL> def findby1 ( session , id ) : <EOL> return session . query ( <EOL> Machine2Jobgroup ) . filter ( <EOL> Machine2Jobgroup . id == id ) . first ( ) <EOL> def findby1machine ( session , machine_id ) : <EOL> return session . query ( <EOL> Machine2Jobgroup ) . filter ( <EOL> Machine2Jobgroup . machine_id == machine_id ) . all ( ) <EOL> def findby1jobgroup ( session , jobgroup_id ) : <EOL> return session . query ( <EOL> Machine2Jobgroup ) . filter ( <EOL> Machine2Jobgroup . jobgroup_id == jobgroup_id ) . all ( ) <EOL> @ dbdelete <EOL> def deleteby1machine ( session , machine_id ) : <EOL> return session . query ( Machine2Jobgroup ) . filter ( <EOL> Machine2Jobgroup . machine_id == machine_id ) . delete ( ) <EOL> @ dbsave <EOL> def save ( session , machine2jobgroup ) : <EOL> session . add ( machine2jobgroup ) <EOL> @ dbupdate <EOL> def update ( session , machine2jobgroup ) : <EOL> session . add ( machine2jobgroup ) <EOL> @ dbdelete <EOL> def delete ( session , machine2jobgroup ) : <EOL> session . delete ( machine2jobgroup ) <EOL> new = Machine2Jobgroup </s>
