def admin_rlms_versions(rlmstype): rlms_type = db_session.query(RLMSType).filter_by(name=rlmstype).first() if rlms_type is not None: versions = rlms_type.versions retrieved_versions = set( (retrieved_version.version for retrieved_version in versions)) if request.method == 'POST' and request.form.get( 'action', '').lower().startswith('add'): for supported_version in get_supported_versions(rlmstype): if supported_version not in retrieved_versions: new_version = RLMSTypeVersion(rlms_type, supported_version) db_session.add(new_version) db_session.commit() versions = rlms_type.versions retrieved_versions = set( (retrieved_version.version for retrieved_version in versions)) any_supported_missing = any([ supported_version not in retrieved_versions for supported_version in get_supported_versions(rlmstype) ]) return render_template("labmanager_admin/rlms_versions.html", versions=versions, name=rlms_type.name, supported=get_supported_versions(rlmstype), any_supported_missing=any_supported_missing) return render_template("labmanager_admin/rlms_errors.html")
def create_rlms(self, rlms, version): supported_types = get_supported_types() if rlms not in supported_types: return "RLMS not found", 404 supported_versions = get_supported_versions(rlms) if version not in supported_versions: return "RLMS version not found", 404 return self._add_or_edit(rlms, version, True, None, {})
def admin_rlms_versions(rlmstype): rlms_type = db_session.query(RLMSType).filter_by(name = rlmstype).first() if rlms_type is not None: versions = rlms_type.versions retrieved_versions = set( (retrieved_version.version for retrieved_version in versions) ) if request.method == 'POST' and request.form.get('action','').lower().startswith('add'): for supported_version in get_supported_versions(rlmstype): if supported_version not in retrieved_versions: new_version = RLMSTypeVersion(rlms_type, supported_version) db_session.add(new_version) db_session.commit() versions = rlms_type.versions retrieved_versions = set( (retrieved_version.version for retrieved_version in versions) ) any_supported_missing = any([ supported_version not in retrieved_versions for supported_version in get_supported_versions(rlmstype)]) return render_template("labmanager_admin/rlms_versions.html", versions = versions, name = rlms_type.name, supported = get_supported_versions(rlmstype), any_supported_missing = any_supported_missing ) return render_template("labmanager_admin/rlms_errors.html")
def create_view(self): rlmss = [] for ins_rlms in get_supported_types(): for ver in get_supported_versions(ins_rlms): rlmss.append((ins_rlms, ver)) return self.render("labmanager_admin/create-rlms.html", rlmss=rlmss)
def create_view(self): rlmss = [] for ins_rlms in get_supported_types(): for ver in get_supported_versions(ins_rlms): rlmss.append((ins_rlms, ver)) return self.render("labmanager_admin/create-rlms.html", rlmss = rlmss)