Class: QgsServerFeatureId

Contains utility functions for using primary keys for feature IDs.

Added in version 3.4.9.

Static Methods

getExpressionFromServerFid

Returns the expression feature id based on primary keys.

getServerFid

Returns the feature id based on primary keys.

pkSeparator

Returns the primary keys separator

updateFeatureRequestFromServerFids

Returns the feature request based on feature ids build with primary keys.

class qgis.server.QgsServerFeatureId[source]

Bases: object

static getExpressionFromServerFid(serverFid: str | None, provider: QgsVectorDataProvider | None) str[source]

Returns the expression feature id based on primary keys.

Parameters:
  • serverFid (Optional[str]) – the feature id build with primary keys

  • provider (Optional[QgsVectorDataProvider]) – the vector layer provider to provide fields and primary keys list

Return type:

str

Returns:

the feature id based on primary keys

Added in version 3.4.9.

static getServerFid(feature: QgsFeature, pkAttributes: Iterable[int]) str[source]

Returns the feature id based on primary keys.

Parameters:
  • feature (QgsFeature) – the feature

  • pkAttributes (Iterable[int]) – the primary keys list

Return type:

str

Returns:

the feature id based on primary keys

Added in version 3.4.9.

static pkSeparator() str[source]

Returns the primary keys separator

Return type:

str

Returns:

@@ the primary keys separator

Added in version 3.4.9.

static updateFeatureRequestFromServerFids(featureRequest: QgsFeatureRequest, serverFids: Iterable[str | None], provider: QgsVectorDataProvider | None) QgsFeatureRequest[source]

Returns the feature request based on feature ids build with primary keys.

Parameters:
  • featureRequest (QgsFeatureRequest) – the feature request to update

  • serverFids (Iterable[Optional[str]]) – the feature ids build with QgsServerFeatureId.getServerFid

  • provider (Optional[QgsVectorDataProvider]) – the vector layer provider to provide fields and primary keys list

Return type:

QgsFeatureRequest

Returns:

the feature request updated

Added in version 3.4.9.