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

The problem of a unique human-readable id vs UUID #636

Open
fguerra06 opened this issue Feb 6, 2025 · 0 comments
Open

The problem of a unique human-readable id vs UUID #636

fguerra06 opened this issue Feb 6, 2025 · 0 comments

Comments

@fguerra06
Copy link

Hello,

I'm dealing with a problem of articulation between UUIDs and human-readable identifiers.

Sorry for the long message but I'll try to be clear...

I have two postgis tables: « polygon » and « points ». Points can be children of polygons.

Image

In Postgis as in Qfieldsynch, the primary key of both tables are uuids. Here is an example with the polygon table:

Image

Each polygon has a type and a number, the combination of them must be unique. This is my auto-calculated and human readable “type_num” field.

Image

In the “points” table, the “fk_polyg” field is a relation reference widget. The display expression is the “type_num” field in the polygon table.

Image

The “id_pol_pt” field is auto-calculated using the “represent value” function. It is my unique human-readable point identifier. It concatenates “fk_polyg” which is supposed to be the display expression “type_num”, the type of point and the point number. « type_num » is itself the result of automatic concatenation in polygon table.

Image

Point labels and display names are based on the « id_pol_pt » field.

Image

When I add a point directly in Qgis, everything works fine. I can see my human-readable identifier.

Image

After exportation, this identifier is recognized by Qfield and all goes well when I add a new point in Qfield. I can see my human-readable field.

Image

The problem occurs when Qfield and Qgis synchronize. QGIS is unable to find the “type_num” component of the polygon. It writes the uuid instead.

Image

I get the following error about the RepresentValue() fonction.

"2025-02-06T15:14:23 WARNING Layer point, field fk_polyg: representValue() with inconsistent layer parameter w.r.t relation referencingLayer"

Image

Is there something wrong with my approach?

Thank you.

Fabien

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

No branches or pull requests

1 participant