Setup-Schema: distractor_words special=m2m per PATCH forcieren
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
10
app.py
10
app.py
@@ -1355,12 +1355,20 @@ def setup_directus_schema():
|
|||||||
})
|
})
|
||||||
|
|
||||||
# ── M2M: questions ↔ words (distractor) via questions_distractor_words ────
|
# ── M2M: questions ↔ words (distractor) via questions_distractor_words ────
|
||||||
do("field questions.distractor_words", "POST", "/fields/questions", {
|
# Feld existiert evtl. schon ohne special → PATCH erzwingen
|
||||||
|
do("field questions.distractor_words (create)", "POST", "/fields/questions", {
|
||||||
"field": "distractor_words", "type": "alias",
|
"field": "distractor_words", "type": "alias",
|
||||||
"meta": {"special": ["m2m"], "interface": "list-m2m",
|
"meta": {"special": ["m2m"], "interface": "list-m2m",
|
||||||
"options": {"template": "{{words_id.title_de}}"},
|
"options": {"template": "{{words_id.title_de}}"},
|
||||||
"note": "Ablenker-Wörter (nicht in Frage/Antwort)"},
|
"note": "Ablenker-Wörter (nicht in Frage/Antwort)"},
|
||||||
})
|
})
|
||||||
|
do("field questions.distractor_words (patch special)", "PATCH", "/fields/questions/distractor_words", {
|
||||||
|
"type": "alias",
|
||||||
|
"meta": {"special": ["m2m"], "interface": "list-m2m",
|
||||||
|
"options": {"template": "{{words_id.title_de}}"},
|
||||||
|
"hidden": False,
|
||||||
|
"note": "Ablenker-Wörter (nicht in Frage/Antwort)"},
|
||||||
|
})
|
||||||
do("relation questions_distractor_words.questions_id→questions", "POST", "/relations", {
|
do("relation questions_distractor_words.questions_id→questions", "POST", "/relations", {
|
||||||
"collection": "questions_distractor_words", "field": "questions_id",
|
"collection": "questions_distractor_words", "field": "questions_id",
|
||||||
"related_collection": "questions",
|
"related_collection": "questions",
|
||||||
|
|||||||
Reference in New Issue
Block a user