Add 1:n pictures

You can add one or more pictures to a feature. Below you find an exemple how to proceed.

Creating two tables

Apiary

  • id (UUID)
  • geometry

Apiary_pictures

  • id
  • apiary_id (UUID)
  • path (TEXT)

Relations

Create a relation with:

  • apiary Referenced layer
  • id Referenced field
  • apiary_picture Referencing layer
  • apiary_id Referencing field
Relations

Widgets

apiary

Set the default value of id to uuid(). No need to show it in the form.

widgets

Set the relation widget to Many to one relation

widgets2

picture

Set the widget type of path to attachment

widget picture