[Qgis-user] Postgres arrays in QGIS and form widget
Olivier Dalang
olivier.dalang at gmail.com
Sun Jan 11 06:17:42 PST 2015
Hi !
Postgres' arrays are a great feature. They allow store several values in
one field :
CREATE TABLE lots(
id serial,
owners text[]
);
INSERT INTO lots(owners) VALUES( ARRAY['john','mike','jenny'] );
But is there a way to edit this cleanly in QGIS with the forms ?
Natively, the form widget will be a plain text input, and the value will
display like this
{"john","mike","jenny"}
This is more or less usable for text fields, but not really clean, since
the user needs to escape some characters, and it's not very readable. But
then it's impossible to use with other widgets (checkbox, range, etc.)
I'd love to have a dynamic input where the user could add and remove
fields, and where QGIS widget types could be used.
Actually, I'd even need a form where I'd have the same number of items for
several arrays, and where adding/removing an item would work on several
field at once, to work on a table like this :
CREATE TABLE lots(
id serial,
first_names text[],
last_names text[],
age int[]
);
Is there a way to do it ?
Maybe with python ?
Has anyone of you already done this and would agree to share ?
Any pointer in the right direction would be very welcome !
Thanks a lot in advance,
Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150111/5b87f862/attachment.html>
More information about the Qgis-user
mailing list