Skip to content

Move the Project.project_details fields data into QgisLayerField model - #1761

Open
manylon wants to merge 4 commits into
masterfrom
QF-8606-new-qgislayerfields-model
Open

Move the Project.project_details fields data into QgisLayerField model#1761
manylon wants to merge 4 commits into
masterfrom
QF-8606-new-qgislayerfields-model

Conversation

@manylon

@manylon manylon commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Currently the Project.project_details stores QGIS information about the current project. What is worse, if we add fields as list of field definitions on each vector layer, we increase the size of project_details field 10-fold.

  • Add QgisLayerField model for storing fields metadata from QgisLayer model
  • Sync fields per layer via QgisLayerFieldQuerySet.update_from_details(), wired into layer creation/update
  • Add migration and read-only Django admin for the new model
  • Remove per-field data in Project.project_details after insertion in QgisLayerField
  • Keep Project.prokect_details in sync for now

UI:
In QGIS projects inline:
image
QGIS layer fields list:
image

- Add `QgisLayerField` model for storing fields metadata from `QgisLayer` model
- Sync fields per layer via `QgisLayerFieldQuerySet.update_from_details()`, wired into layer creation/update
- Add migration and read-only Django admin for the new model
- Remove per-field data in `Project.project_details` after insertion in `QgisLayerField`
@duke-nyuki

Copy link
Copy Markdown
Collaborator

Comment thread docker-app/qfieldcloud/core/admin.py Outdated
Comment thread docker-app/qfieldcloud/project/models.py Outdated
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

Successfully merging this pull request may close these issues.

3 participants