openlibhums / openlibhums/janeway

Expand settings modelling to be compatible with arbitrary site types

Open
#3,528 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Infrastructure janeway 2.0 new feature
Dominant language
Python
Stars
238
Forks
97
Avg merge
9d 1h
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.
Janeway implements a set of models for translatable and end-user configurable settings that currently provide configuration options for journal sites. We want to expand this functionality to arbitrary site types such as Repository and Press models

Describe the solution you'd like
We want to expand this functionality to arbitrary site types such as Repository and Press models

  • As a press/repository manager, I am able to configure sites using settings that can be translated.
  • As a press/repository manager, I am able to configure sites using setting defaults
  • As a developer, I can provide custom settings for repository/press sites from a plugin

Additional context
Given our frustration with generic foreign keys and deterministic iteration in order to implement generic relations between models, this could be a good feature to test Single Table Inheritance (STI). The django-typed-models library achieves STI without violating the API of the base Manager class provided by django: https://github.com/craigds/django-typed-models

A complete implementation using this library could provide an API yielding the following sample result:

>>> SettingValue.objects.filter(name="setting_name", group="group").values_list("site", flat=True)
>>> [<Journal: tj:testjournal;.com>, <Press: press.com>, <Repository: repository.com>]

It would also be desirable to limit a Setting object to a given number of site types. For example if a setting should be journal specific, it should not be listed during the configuration of other site types.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing settings models and journal-site configuration flow, then review how django-typed-models could support the proposed site types. Done means translated settings, defaults, plugin-provided settings, and site-type restrictions work for journal, press, and repository sites.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.