Skip to content

Layer UUID hook #6952

@mattiagiupponi

Description

@mattiagiupponi

The current generation of the UUID for the Layers is based on those two lines:

instance.uuid = str(uuid.uuid1()) in geonode/geonode/layers/models.py
layer_uuid = str(uuid.uuid1()) in geonode/geonode/upload/upload.py

We want to let the UUID creation be pluggable and let the user use his own UUID generator based on their needs.

if hasattr(settings, 'LAYER_UUID_HANDLER') and settings.LAYER_UUID_HANDLER != '':
        from geonode.layers.utils import get_uuid_handler
        instance.uuid = get_uuid_handler()(instance).create_uuid()

And is enough to add this config in settings.py by specifying the object that is responsible to manage the new UUID

LAYER_UUID_HANDLER = "mymodule.myfile.MyObject"

More information related to the configuration are available in this PR

Documentation PR at this link

Metadata

Metadata

Labels

featureA new feature to be added to the codebase

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions