<s> from constants import * <EOL> from db import db , Admiral , AdmiralQuest , Quest , Ship , AdmiralEquipment <EOL> def ship_add ( admiral_id , ship_id ) : <EOL> admiral = db . session . query ( Admiral ) . get ( admiral_id ) <EOL> admiral . add_kanmusu ( ship_id ) <EOL> ship = db . session . query ( Ship ) . get ( ship_id ) <EOL> print ( "<STR_LIT>" . format ( ship . name , admiral . id ) ) <EOL> def quest_add ( admiral_id , quest_id ) : <EOL> admiral = db . session . query ( Admiral ) . get ( admiral_id ) <EOL> admiral . unlock_quest ( admiral ) <EOL> print ( "<STR_LIT>" ) <EOL> def quest_complete ( admiral_id , quest_id ) : <EOL> db . session . query ( AdmiralQuest ) . filter ( Admiral . id == admiral_id , Quest . id == quest_id ) . update ( <EOL> { "<STR_LIT:state>" : QUEST_STATE_COMPLETE } ) <EOL> db . session . commit ( ) <EOL> print ( "<STR_LIT>" ) <EOL> def equip_add ( admiral_id , equip_id ) : <EOL> db . session . add ( AdmiralEquipment ( admiral_id = admiral_id , equipment_id = equip_id ) ) <EOL> db . session . commit ( ) <EOL> print ( "<STR_LIT>" ) </s>
