<s> from piston . handler import BaseHandler <EOL> from piston . utils import rc , require_mime , require_extended <EOL> from snapboard . models import Thread <EOL> from snapboard . api . forms import ThreadForm <EOL> class ThreadHandler ( BaseHandler ) : <EOL> allowed_methods = ( '<STR_LIT:POST>' , ) <EOL> model = Thread <EOL> def create ( self , request ) : <EOL> """<STR_LIT>""" <EOL> form = ThreadForm ( request . POST or None , request = request ) <EOL> if form . is_valid ( ) : <EOL> form . save ( ) <EOL> return rc . CREATED <EOL> return rc . BAD_REQUEST </s>
