0

I would like to ask if someone knows a way to press the "select all" button in Project>Properties>QGIS Server>WFS capabilities using python, or if is there a specific command to do the same thing.

Vince
  • 20,017
  • 15
  • 45
  • 64
Pivi
  • 1

1 Answers1

1

Try the following

vectorLayers = [layer.id() for layer in QgsProject.instance().mapLayers().values() if isinstance(layer, QgsVectorLayer)]
QgsProject.instance().writeEntry( "WFSLayers" , "/", vectorLayers);
QgsProject.instance().write()

Adapted from my previous answer Publishing a layer as WFS with PyQGIS

ThomasG77
  • 30,725
  • 1
  • 53
  • 93