where ckan.datastore.auto_alias_template is a python format() string, with predefined placeholder values {package-id}, {resource-title}, {organization-id}, etc, and a default setting of "{package-id}-{resource-title}" or "{organization-id}-{package-id}-{resource-title}"
when datastore_create is called and auto_alias is True, it will automatically create the alias using the template. The existing behavior of existing aliases being overwritten is actually desirable, as this allows Datastore API users to use the latest resource using the alias without depending on the resource-id hash and make their code more readable.
This ability is quite useful with scheming as well, especially if you're using the datastore_choices_helper, as your scheming configuration will not have to hardcode a resource-id, and will automatically use the latest version of the resource using the alias.
A CKAN configuration option to set resource alias automatically:
where ckan.datastore.auto_alias_template is a python format() string, with predefined placeholder values {package-id}, {resource-title}, {organization-id}, etc, and a default setting of "{package-id}-{resource-title}" or "{organization-id}-{package-id}-{resource-title}"
when
datastore_create
is called and auto_alias is True, it will automatically create the alias using the template. The existing behavior of existing aliases being overwritten is actually desirable, as this allows Datastore API users to use the latest resource using the alias without depending on the resource-id hash and make their code more readable.This ability is quite useful with scheming as well, especially if you're using the datastore_choices_helper, as your scheming configuration will not have to hardcode a resource-id, and will automatically use the latest version of the resource using the alias.
cc @ckan/core