Skip to content

[Task] Create Resource model in content app & migrate all resource instances #125

@mradamcox

Description

@mradamcox

Describe the task

Currently, the loc_insurancemaps app has a ResourceBase model that is inherited by the Layer and Document proxy models. Conceptually, this is still something of a holdover from the GeoNode CMS; even though GeoNode's Document and Layer models were replaced with my own here, to ease that transition I mimicked that CMS more closely than is really necessary going forward. In reality, the Layer model offers very little extra functionality over the Document model, so the functional need for these two different proxy models is dubious.

Further, the need to store a separate database instance for a Document alongside a Layer instance (which results directly from the process of georeferencing it, e.g. holds the GeoTIFF) doesn't really hold up under scrutiny. There is no functional reason these two instances can't be combined and reference the original map scan through one field and the resulting GeoTIFF in another field. Thus, each Document/Layer pair can and should ultimately be combined into a single new Resource instance.

Completion criteria

  • Create a new Resource model in the content app
  • Add all necessary methods to support the current needs for Documents and Layers
  • Reevaluate all attributes on the existing ResourceBase model
  • Add field hold the original image file and a separate one for the GeoTIFF
  • Take stock of where in the app existing Layer/Document functionality will need to be updated
    • For example, Volume().layer_lookup and Volume().document_lookup would now obviously be merged into something like resource_lookup and the Volume summary will need to handle this new lookup.
    • For the purposes of this ticket, just a research summary will suffice to complete this step

Additional context
Add any other context about the problem here, use #<issue number> to add a reference to a related issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: maintenanceUnderlying updates, upgrades, and general upkeep

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions