Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value by default in postgresql table does not appear in lizmap #75

Closed
jancelin opened this issue Jul 24, 2014 · 8 comments
Closed

value by default in postgresql table does not appear in lizmap #75

jancelin opened this issue Jul 24, 2014 · 8 comments
Assignees
Labels
Milestone

Comments

@jancelin
Copy link
Collaborator

the value by default in postgresql table does not appear in lizmap but work fine in qgis

@mdouchin mdouchin added this to the 2.10 milestone Aug 25, 2014
@mdouchin mdouchin self-assigned this Aug 25, 2014
@mdouchin
Copy link
Collaborator

Could you be more specific ? If I understand correctly, you have some fields in your table with a default value set, and this value is not used when the user does not write another value in Lizmap form for this field ?

@mdouchin mdouchin added the bug label Aug 25, 2014
@jancelin
Copy link
Collaborator Author

Sorry, It's for a postgresql view, not a table:

CREATE OR REPLACE VIEW inv_gps_view AS
SELECT row_number() OVER () AS unique_id, inventaire_gps.ig_id,
inventaire_gps.ig_date, inventaire_gps.ig_buffer, inventaire_gps.ig_cla_id,
classe_quantite.cla_gps2, inventaire_gps.ig_id_plante,
t_plante.nom_francais, inventaire_gps.ig_terrain_id, t_terrain.type_terrain,
inventaire_gps.ope_id, operateur_utilisateur.ope_nom_pre,
inventaire_gps.geom
FROM t_terrain, t_plante, operateur_utilisateur,
inventaire_gps
LEFT JOIN classe_quantite ON inventaire_gps.ig_cla_id = classe_quantite.cla_id
WHERE inventaire_gps.ig_id_plante = t_plante.id_plante AND inventaire_gps.ig_terrain_id = t_terrain.id_terrain AND inventaire_gps.ope_id = operateur_utilisateur.ope_id;

ALTER TABLE inv_gps_view
OWNER TO postgres;
ALTER TABLE inv_gps_view ALTER COLUMN ig_buffer SET DEFAULT 3000;

My default value is 3000 but it's not appear in lizmap

@rldhont rldhont modified the milestones: 2.11, 2.10 Sep 12, 2014
rldhont added a commit that referenced this issue Feb 10, 2015
@jancelin
Copy link
Collaborator Author

works well, thanks

@mdouchin
Copy link
Collaborator

mdouchin commented Dec 6, 2016

@jancelin Can you test again with your view (described above) in Lizmap release_3_0 by commenting this line ?
https://github.com/3liz/lizmap-web-client/blob/release_3_0/lizmap/modules/lizmap/controllers/edition.classic.php#L1163

I tried it myself with a very simple view, and this is not needed anymore since some further modifications in the edition code. Grabing default values representation from PostgreSQL and putting it in the form leads to side effects such as #417

@mdouchin
Copy link
Collaborator

ping @jancelin ;)

@mdouchin mdouchin reopened this Dec 14, 2016
@rldhont
Copy link
Collaborator

rldhont commented Dec 21, 2016

Reopened if a9cd647 not help

@rldhont rldhont closed this as completed Dec 21, 2016
@jancelin
Copy link
Collaborator Author

I test in January, désolé du retard mais je sème mon orge de brasserie.

@jancelin
Copy link
Collaborator Author

hi,
I just tested with version 3.1beta4

  • The default value for the integer works well.
  • The default value for a relational value on a table edition is OK
  • The default value for a relational value on a View edition is not available, The same if we edit the default value of qgis.

test_formulaire_-demo-lizmap-_2017-01-10_14 51 38
test_formulaire_-demo-lizmap-_2017-01-10_14 50 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants