Bug report #15517
Automatic recognition of data types in forms
|Affected QGIS version:||2.14.3||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||duplicate|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||23441|
In the table below, the configuration for the test database is provided. The database has only a custom domain and a table called test.test created.
CREATE EXTENSION postgis;
DROP SCHEMA IF EXISTS test CASCADE;
CREATE SCHEMA test;
CREATE TYPE test.domain_test AS ENUM ('value1', 'value2', 'value3');
CREATE TABLE test.test
id bigint NOT NULL PRIMARY KEY,
geom geometry(Linestring, 32628),
date_field timestamp with time zone,
domain_field test.domain_test NOT NULL,
After we load the test table, if we check the properties of the layer fields by going to “Layer” > “Properties …” > “Fields” we can see that although the type name is correctly filled in, the edit widgets are always “Text Edit” by default:
With the default configuration, when we try to insert a new feature, every input box in the fold is a text edit box:
However, we want to make the process of entering data as easy as possible for our GIS user by providing the most useful widget for each data type. For example, something like:
In that case we had to manually set every field as it is shown in the image below:
The problem, besides to automatically recognition of data types, is that this manual process is quite tedious, time consuming (we have more close to one hundred tables) and error prone. Even if we provide to our users a prepared project with the correct configuration, the system could grow or they could have to configure the project again to add different layers.
Is there any utility in QGIS that could help us to make this process in an automatic way?