Bug report #7924

QGIS Server: GetProjectSettings lists field type with QString instead of boolean

Added by Andreas Neumann almost 11 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Normal
Assignee:Marco Hugentobler
Category:QGIS Server
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:16795

Description

I sometimes use boolean data types represented with checkboxes. In QWC (QGIS web client) I want to display them with yes/no instead of "t" and "f". I need to therefore detect these boolean values.

In the output of the GetProjectSettings reponse I get the type as QString. I cannot use the edit type, because in this setup the edit type is set to "Hidden". I want to hide them in QGIS desktop but show them in QGIS Web Client.

So, is there a chance that the boolean values (set to boolean in Postgis) would be reported as boolean and not as a QString?


example output of GetProjectSettings:

<Attributes>
<Attribute precision="0" length="-1" editType="Immutable" type="int" comment="" name="GID (Punktelement)"/>
<Attribute precision="0" length="-1" editType="ValueRelation" type="int" comment="" name="GID Baustellenprojekt"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Projekt-Nr Uster"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Objekt- oder Projektbezeichnung"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Perimeter"/>
<Attribute precision="0" length="-1" editType="Hidden" type="QString" comment="" name="Bauherr"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Planungs- oder Ingenieurbüro"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Ansprechsperson Planungs- oder Ingenieurbüro"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Tel-Nr. Ansprechsperson Planungs- oder Ingenieurbüro"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Projektleiter Stadt Uster"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Projektleiter Energie Uster AG"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Projektleiter Kanton Zürich"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Tempo 30 Zone"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Vorhandenes Planungskonzept"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betriebs- und Gestaltungskonzept"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen Strasse"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen öffentlicher Kanal"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen Liegenschaftsentwässerung"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen Gas"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen Wasser"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen Elektro"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen öffentliche Beleuchtung"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen Swisscom"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Betroffen Cablecom"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QDate" comment="" name="Start Bauprojekt"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QDate" comment="" name="Start Koordination Werke"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QDate" comment="" name="Start Submission"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QDate" comment="" name="Baubeginn"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QDate" comment="" name="Bauende"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Ausführungsjahr"/>
<Attribute precision="-1" length="-1" editType="Hidden" type="QString" comment="" name="Bemerkung"/>
<Attribute precision="-1" length="-1" editType="Immutable" type="QString" comment="" name="tooltip"/>
</Attributes>

in the above example all of the "Betroffen_xxx" attributes are actually of type boolean, but are reported as "QString".

History

#1 Updated by Andreas Neumann almost 11 years ago

Alternatively it would be useful to have an additional column in the fields tab called "Desktop" that separates the "Hidden" from the widget choice.

This would be even more flexible and elegant.

#2 Updated by Andreas Neumann almost 10 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

This was already implemented in QGIS server a while ago.

Also available in: Atom PDF