Make built-in models abstract

Offen
#56 8 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Refactoring
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
django, python
Bereich
backend, content

Rechercherichtung

Beginne damit, die integrierten Modelle, StreamField blocks, CODERED_FRONTEND_* settings, die Snippet-Verarbeitung und die im Issue erwähnte Projektvorlage zu erfassen. Ermittle, wie sich abstrakte Modelle auf die Auswahl von Snippets, Navbar-/Footer-Templates und Migrationen auswirken würden; als abgeschlossen gilt die Aufgabe, wenn ein dokumentiertes Design vorliegt, das projektspezifische Setting-Migrationen ohne übermäßigen Boilerplate-Code vermeidet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Area: Core ⚙ skill: coderedcms Type: Tech Debt

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.

Vorherrschende Sprache
Python
Sterne
762
Forks
153
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus coderedcorp/coderedcms

Alle Issues in coderedcorp/coderedcms

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.