Class: QgsProjectServerValidator

class qgis.core.QgsProjectServerValidator

Bases: sip.wrapper

Validates the server specific parts of the configuration of a QGIS project.

New in version 3.14.

QgsProjectServerValidator() Constructor for QgsProjectServerValidator.

QgsProjectServerValidator(QgsProjectServerValidator)

Methods

displayValidationError

Returns a human readable string for a given error.

validate

Validates a project to detect problems on QGIS Server, and returns True if it's considered valid.

Attributes

DuplicatedNames

LayerEncoding

LayerShortName

ProjectRootNameConflict

ProjectShortName

DuplicatedNames = 0
LayerEncoding = 2
LayerShortName = 1
ProjectRootNameConflict = 4
ProjectShortName = 3
class ValidationError

Bases: int

class ValidationResult(error: QgsProjectServerValidator.ValidationError, identifier: Any)

Bases: sip.wrapper

Constructor for ValidationResult.

QgsProjectServerValidator.ValidationResult(QgsProjectServerValidator.ValidationResult)

error
identifier
displayValidationError(error: QgsProjectServerValidator.ValidationError) str

Returns a human readable string for a given error.

Parameters

error (QgsProjectServerValidator.ValidationError) – the error.

Return type

str

Returns

the human readable error.

validate(project: QgsProject) Tuple[bool, List[QgsProjectServerValidator.ValidationResult]]

Validates a project to detect problems on QGIS Server, and returns True if it’s considered valid. If validation fails, the results list will be filled with a list of items describing why the validation failed and what needs to be rectified

Parameters

project (QgsProject) – input project to check

Return type

Tuple[bool, List[QgsProjectServerValidator.ValidationResult]]

Returns

  • bool

  • results: results of the validation