coderedcorp / coderedcorp/coderedcms

Make built-in models abstract

Open
#56 8 comments 1 reaction 0 assignees View on GitHub
Area: Core ⚙ skill: coderedcms Type: Tech Debt
Dominant language
Python
Stars
765
Forks
154
PR merge metrics
No merged PRs in 30d

Description

If we want to continue using CODERED_FRONTEND_* settings (which I think we do, they will be the foundation of themes), we will have to make everything that uses our streamfield blocks abstract.

The issue is, many coderedcms models use streamfield blocks that pull values from CODERED_FRONTEND_* settings. Which means if you change one of these settings in your project, it triggers a migration in coderedcms. Which is a bad practice and leads to endless migrations.

This fits in with the paradigm we have been following with the page types. Provide beefy abstract models, and provide a very basic concrete model boilerplate in the project template.

One caveat to making the snippets abstract, is that we will no longer be able to provide a snippet chooser, or hard-code templates that pull in navbar/footer snippets. So this will have to be thought through to figure out how to gracefully handle all of this without re-defining everything in the project template (which would be too much boilerplate I think).

Anyhow, this pretty major regarding future stability. Implementing it will inevitably be a breaking change. But there is no other way to have dynamic blocks and themes. So I think it is necessary.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by mapping the built-in models, StreamField blocks, CODERED_FRONTEND_* settings, snippet handling, and the project template mentioned in the issue. Determine how abstract models would affect snippet choosing, navbar/footer templates, and migrations; done requires a documented design that avoids project-specific setting migrations without excessive boilerplate.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, content
Issue type
Refactor
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.