def add_class(classname, cls):
 if (classname in cls._decl_class_registry):
  existing = cls._decl_class_registry[classname]
  if (not isinstance(existing, _MultipleClassMarker)):
   existing = cls._decl_class_registry[classname] = _MultipleClassMarker([cls, existing])
 else:
  cls._decl_class_registry[classname] = cls
 try:
  root_module = cls._decl_class_registry['_sa_module_registry']
 except KeyError:
  cls._decl_class_registry['_sa_module_registry'] = root_module = _ModuleMarker('_sa_module_registry', None)
 tokens = cls.__module__.split('.')
 while tokens:
  token = tokens.pop(0)
  module = root_module.get_module(token)
  for token in tokens:
   module = module.get_module(token)
  module.add_class(classname, cls)

def add_class ( classname , cls ) : if ( classname in cls . _decl_class_registry ) : existing = cls . _decl_class_registry [ classname ] if ( not isinstance ( existing , _MultipleClassMarker ) ) : existing = cls . _decl_class_registry [ classname ] = _MultipleClassMarker ( [ cls , existing ] ) else : cls . _decl_class_registry [ classname ] = cls try : root_module = cls . _decl_class_registry [ '_sa_module_registry' ] except KeyError : cls . _decl_class_registry [ '_sa_module_registry' ] = root_module = _ModuleMarker ( '_sa_module_registry' , None ) tokens = cls . __module__ . split ( '.' ) while tokens : token = tokens . pop ( 0 ) module = root_module . get_module ( token ) for token in tokens : module = module . get_module ( token ) module . add_class ( classname , cls )
URL inserts classes into template variables that contain html tags .