<s> from __future__ import absolute_import <EOL> import logging <EOL> from freight . config import db , queue <EOL> from freight . models import App <EOL> models = { <EOL> '<STR_LIT>' : App , <EOL> } <EOL> @ queue . job ( ) <EOL> def delete_object ( model , object_id ) : <EOL> try : <EOL> Model = models [ model ] <EOL> except KeyError : <EOL> logging . error ( '<STR_LIT>' , model ) <EOL> return <EOL> obj = Model . query . get ( object_id ) <EOL> if not obj : <EOL> logging . warning ( '<STR_LIT>' , model , object_id ) <EOL> return <EOL> db . session . delete ( obj ) </s>
