Skip to content

Replace extraMetadata with sparse fields #2490

@etj

Description

@etj

Issue related to GeoNode/geonode#14000

The extraMetadata field was introduced in order to store custom metadata without modifying the model.
After the introduction of the new metadata json schema and the possibility to access the sparse metadata fields, the extraMetadata field becomes outdated.

External clients (if any) using the API for handling the extraMetadata should be updated to use the new sparse field API.

The PR implementing these changes on GeoNode is currently failing due to an error on the mapstore client module still referencing the extrametadata.
The traceback is in the following collapsed section:

Error log
  Traceback (most recent call last):
    File "/usr/src/geonode/manage.py", line 29, in <module>
      execute_from_command_line(sys.argv)
    File "/usr/src/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
      utility.execute()
    File "/usr/src/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 416, in execute
      django.setup()
    File "/usr/src/venv/lib/python3.12/site-packages/django/__init__.py", line 24, in setup
      apps.populate(settings.INSTALLED_APPS)
    File "/usr/src/venv/lib/python3.12/site-packages/django/apps/registry.py", line 124, in populate
      app_config.ready()
    File "/usr/src/venv/lib/python3.12/site-packages/geonode_mapstore_client/apps.py", line 331, in ready
      run_setup_hooks()
    File "/usr/src/venv/lib/python3.12/site-packages/geonode_mapstore_client/apps.py", line 106, in run_setup_hooks
      **settings.EXTRA_METADATA_SCHEMA,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/src/venv/lib/python3.12/site-packages/django/conf/__init__.py", line 83, in __getattr__
      val = getattr(_wrapped, name)
            ^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: 'Settings' object has no attribute 'EXTRA_METADATA_SCHEMA'

A discussion/investigation is needed about new settings in the geonode core to make the new client aware about custom sparse fields.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions