Skip to content

Commit

Permalink
Expose QgsServerFeatureId to Python
Browse files Browse the repository at this point in the history
the namespace contains some vital functions for web applications
that want to use the QgsServer API.
  • Loading branch information
elpaso committed Oct 29, 2021
1 parent 5195032 commit 375bf6d
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 3 deletions.
78 changes: 78 additions & 0 deletions python/server/auto_generated/qgsserverfeatureid.sip.in
@@ -0,0 +1,78 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverfeatureid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/







%ModuleHeaderCode
#include "qgsserverfeatureid.h"
%End



namespace QgsServerFeatureId
{

QString getServerFid( const QgsFeature &feature, const QgsAttributeList &pkAttributes );
%Docstring
Returns the feature id based on primary keys.

:param feature: the feature
:param pkAttributes: the primary keys list

:return: the feature id based on primary keys

.. versionadded:: 3.4.9
%End

QgsFeatureRequest updateFeatureRequestFromServerFids( QgsFeatureRequest &featureRequest, const QStringList &serverFids, const QgsVectorDataProvider *provider );
%Docstring
Returns the feature request based on feature ids build with primary keys.

:param featureRequest: the feature request to update
:param serverFids: the feature ids build with :py:class:`QgsServerFeatureId`.getServerFid
:param provider: the vector layer provider to provide fields and primary keys list

:return: the feature request updated

.. versionadded:: 3.4.9
%End

QString getExpressionFromServerFid( const QString &serverFid, const QgsVectorDataProvider *provider );
%Docstring
Returns the expression feature id based on primary keys.

:param serverFid: the feature id build with primary keys
:param provider: the vector layer provider to provide fields and primary keys list

:return: the feature id based on primary keys

.. versionadded:: 3.4.9
%End

QString pkSeparator();
%Docstring
Returns the primary keys separator

:return: @@ the primary keys separator

.. versionadded:: 3.4.9
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverfeatureid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/server/server_auto.sip
Expand Up @@ -25,6 +25,7 @@
%Include auto_generated/qgsserverinterface.sip
%End
%Include auto_generated/qgsserverprojectutils.sip
%Include auto_generated/qgsserverfeatureid.sip
%Include auto_generated/qgsserverrequest.sip
%Include auto_generated/qgsserverresponse.sip
%Include auto_generated/qgsservice.sip
Expand Down
3 changes: 2 additions & 1 deletion src/server/CMakeLists.txt
Expand Up @@ -35,11 +35,11 @@ set(QGIS_SERVER_SRCS
qgsserverparameters.cpp
qgsserverexception.cpp
qgsserverfilter.cpp
qgsserverfeatureid.cpp
qgsserverinterface.cpp
qgsserverinterfaceimpl.cpp
qgsserverlogger.cpp
qgsserverprojectutils.cpp
qgsserverfeatureid.cpp
qgsserverrequest.cpp
qgsserverresponse.cpp
qgsserversettings.cpp
Expand All @@ -64,6 +64,7 @@ set (QGIS_SERVER_HDRS
qgsserverogcapihandler.h
qgsserverstatichandler.h
qgsserverparameters.h
qgsserverfeatureid.h
qgsserverquerystringparameter.h
qgsserversettings.h
qgsservicemodule.h
Expand Down
4 changes: 2 additions & 2 deletions src/server/qgsserverfeatureid.h
Expand Up @@ -18,8 +18,6 @@
#ifndef QGSSERVERFEATUREID_H
#define QGSSERVERFEATUREID_H

#define SIP_NO_FILE

#include <QString>
#include <QHash>

Expand All @@ -30,13 +28,15 @@ class QgsVectorDataProvider;
class QgsFeature;
class QgsFeatureRequest;


#ifdef SIP_RUN
% ModuleHeaderCode
#include "qgsserverfeatureid.h"
% End
#endif



/**
* \ingroup server
* \brief The QgsServerFeatureId namespace provides a way to use primary keys for
Expand Down

0 comments on commit 375bf6d

Please sign in to comment.