Skip to content

Refact codelists into thesauri #14353

Description

@etj

WIP

¿ complex enough to be a GNIP ?

Current status

ISO codelists

There are some ISO metadata elements that have their own classes in GeoNode, with a common model:

  • RestrictionCodeType
  • SpatialRepresentationType
  • TopicCategory

All of them share the same model:

identifier = models.CharField(max_length=255, default="location")
description = models.TextField(default="")
gn_description = models.TextField("GeoNode description", default="", null=True)
is_choice = models.BooleanField(default=True)

while TopicCategory also has

fa_class = models.CharField(max_length=64, default="fa-times")

This model does not include localization, which is handled in the .po files.

Frequencies

Frequency field is defined as:

    maintenance_frequency = models.CharField(
        _("maintenance frequency"),
        max_length=255,
        choices=enumerations.UPDATE_FREQUENCIES,
        ...

UPDATE_FREQUENCIES is defined as:

UPDATE_FREQUENCIES = (
    ("unknown", _("frequency of maintenance for the data is not known")),
    ("continual", _("data is repeatedly and frequently updated")),
    ("notPlanned", _("there are no plans to update the data")),

and localization is performed via .po files:

msgid "frequency of maintenance for the data is not known"
msgstr "la frequenza di manutenzione dei dati non è nota"

msgid "data is repeatedly and frequently updated"
msgstr "i dati vengono ripetutamente e frequentemente aggiornati"

Licenses

class License(models.Model):
    identifier = models.CharField(max_length=255, editable=False)
    name = models.CharField(max_length=255)
    abbreviation = models.CharField(max_length=20, null=True, blank=True)
    description = models.TextField(null=True, blank=True)
    url = models.URLField(max_length=2000, null=True, blank=True)
    license_text = models.TextField(null=True, blank=True)

Proposal

We could refactor these info into well known thesauri: it would

  • enable localization
  • reduce the number of classes/tables

ThesaurusKeyword has an image field (see #11617 and #11622):

    image = models.CharField(max_length=512, help_text="A URL to an image", null=True, blank=True)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions