#NEWLINE# @ register . simple_tag ( takes_context = True ) #NEWLINE# def getblock( context , prefix , suffix = None ) : #NEWLINE# #INDENT# key = prefix #NEWLINE# if suffix : #NEWLINE# #INDENT# key += str ( suffix ) #NEWLINE# #UNINDENT# if ( not ( 'blocks' in context ) ) : #NEWLINE# #INDENT# raise TemplateSyntaxError ( "setblock/endblock can only be used with SmartView or it's subclasses" ) #NEWLINE# #UNINDENT# if ( key in context [ 'blocks' ] ) : #NEWLINE# #INDENT# return context [ 'blocks' ] [ key ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ''