#NEWLINE# def post( self , entity_id = None ) : #NEWLINE# #INDENT# 'HTML POST handler. \n    \n    Save changes to the given monster.' #NEWLINE# template_values = self . build_template_values ( ) #NEWLINE# if ( not template_values [ handlers . base . PROFILE_KEY ] . is_publisher ) : #NEWLINE# #INDENT# return self . forbidden ( ) #NEWLINE# #UNINDENT# monster = Monster ( ) #NEWLINE# monster . product = int ( self . request . get ( 'product' ) ) #NEWLINE# monster . creator = sq [ handlers . base . PROFILE_KEY ] #NEWLINE# if ( monster . product == ( - 1 ) ) : #NEWLINE# #INDENT# monster . is_core = True #NEWLINE# #UNINDENT# license = self . request . get ( 'license' ) #NEWLINE# if license : #NEWLINE# #INDENT# monster . license = configuration . site . licenses [ license ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# name = self . request . get ( 'name' ) #NEWLINE# if name : #NEWLINE# #INDENT# monster . name = name #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# tags = self . request . get ( 'tags' ) #NEWLINE# if tags : #NEWLINE# #INDENT# for tag in tags . split ( ', ' ) : #NEWLINE# #INDENT# monster . tags . append ( tag ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# damage = self . request . get ( 'damage' ) #NEWLINE# if damage : #NEWLINE# #INDENT# monster . damage = damage #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# hp = self . request . get ( 'hp' ) #NEWLINE# if hp : #NEWLINE# #INDENT# monster . hp = hp #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# armor = self . request . get ( 'armor' ) #NEWLINE# if armor : #NEWLINE# #INDENT# monster . armor = armor #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# damage_tags = self . request . get ( 'damage_tags' ) #NEWLINE# if damage_tags : #NEWLINE# #INDENT# for tag in damage_tags . split ( ', ' ) : #NEWLINE# #INDENT# monster . damage_tags . append ( tag ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# special_qualities = self . request . get ( 'special_qualities' ) #NEWLINE# if special_qualities : #NEWLINE# #INDENT# for sq in special_qualities . split ( ', ' ) : #NEWLINE# #INDENT# monster . special_qualities . append ( sq ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# description = self . request . get ( 'description' ) #NEWLINE# if armor : #NEWLINE# #INDENT# monster . description = description #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# instinct = self . request . get ( 'instinct' ) #NEWLINE# if instinct : #NEWLINE# #INDENT# monster . instinct = instinct #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# moves = self . request . get ( 'moves' ) #NEWLINE# if moves : #NEWLINE# #INDENT# for move in moves . split ( '\n' ) : #NEWLINE# #INDENT# monster . moves . append ( move ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return self . error ( ) #NEWLINE# #UNINDENT# monster . put ( ) #NEWLINE# return self . redirect ( self . uri_for ( 'monster' , entity_id = monster . key ( ) . id ( ) ) )