示例#1
0
文件: importer.py 项目: tbalaz/test
    def license_2_license_id(self, license_title, logger=None):
        # import is here, as it creates a dependency on ckan, which
        # many importers won't want
        from ckan.model.license import LicenseRegister

        licenses = LicenseRegister()
        license_obj = licenses.get_by_title(license_title)
        if license_obj:
            return u"%s" % license_obj.id
        else:
            logger("Warning: No license name matches '%s'. Ignoring license." % license_title)