Feature request #15516

Automatic recognition of data types in forms

Added by Pablo Fernández Moniz about 4 years ago. Updated almost 3 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Unknown
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:23440

Description

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,
boolean_field boolean,
comments text
);

Database configuration

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?


Related issues

Duplicated by QGIS Application - Bug report #15517: Automatic recognition of data types in forms Closed 2016-09-02

History

#1 Updated by Jürgen Fischer about 4 years ago

  • Tracker changed from Bug report to Feature request

#2 Updated by Jürgen Fischer about 4 years ago

See also PR#3439

#3 Updated by Giovanni Manghi over 3 years ago

  • Easy fix? set to No

#4 Updated by Jürgen Fischer almost 3 years ago

  • Category set to Unknown

Also available in: Atom PDF