@register.filter
def bootstrap_message_classes(message):
 extra_tags = None
 try:
  extra_tags = message.extra_tags
 except AttributeError:
  pass
 if (not extra_tags):
  extra_tags = u''
 classes = [extra_tags]
 try:
  level = message.level
 except AttributeError:
  pass
 else:
  try:
   classes.append(MESSAGE_LEVEL_CLASSES[level])
  except KeyError:
   classes.append(u'alert alert-danger')
 return u' '.join(classes).strip()

@ register . filter def bootstrap_message_classes ( message ) : extra_tags = None try : extra_tags = message . extra_tags except AttributeError : pass if ( not extra_tags ) : extra_tags = u'' classes = [ extra_tags ] try : level = message . level except AttributeError : pass else : try : classes . append ( MESSAGE_LEVEL_CLASSES [ level ] ) except KeyError : classes . append ( u'alert alert-danger' ) return u' ' . join ( classes ) . strip ( )
return the message classes for a message .