teksi / district_heating

Future TEKSI distance heating module
GNU General Public License v3.0
0 stars 0 forks source link

Editable views for QGIS pipe_point_normal and pipe_point_feed #22

Open jpdupuy opened 1 month ago

jpdupuy commented 1 month ago

0001_views.zip I fixed the temporary views according to the changes in the datamodel But I shall need the final editable views for the QGIS project file

sjib commented 1 month ago

But I shall need the final editable views for the QGIS project file @jpdupuy What do you mean with that?

jpdupuy commented 1 month ago

@sjib I recieve the follwoing message trying to insert a new pipe_feed with QGIS

Impossible de valider les changements pour la couche vw_pipe_point_feed

Erreurs : ERROR: 1 feature(s) not added.

Erreur du fournisseur de données : Erreur PostGIS lors de l'ajout d'entité : ERROR: cannot insert into view "vw_pipe_point_feed" DETAIL: Views that do not select from a single table or view are not automatically updatable. HINT: To enable inserting into the view, provide an INSTEAD OF INSERT trigger or an unconditional ON INSERT DO INSTEAD rule.

Arnaud told me there is a special mechanism to create editable views for TEKSI

sjib commented 1 month ago

@jpdupuy These viewswith all needed triggers will be generated automatically once the CI is working: see https://github.com/teksi/district_heating/blob/d147e1dfa3e19ff506963f3782c2469f12ce02de/datamodel/app/create_app.py#L79