def get_backend_choices(clas): """ Return a tuple of available backends as used by choice fields. """ choices = [] if hasattr(settings, "WEBDAV_BACKENDS"): for item in settings.WEBDAV_BACKENDS: cls = get_class(item) try: choices.append((item, "%s / %s"%(cls.get_category(), cls.get_name()))) except ClassNotFoundException, cnfe: logger.warning(cnfe) return tuple(choices)
def get_backend_class(self): try: return get_class(self.backend) except ClassNotFoundException, cnfe: logger.warning(cnfe)