-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added: Add multi-languageBlockTranslatedContent
in relation to Block
#1227
Conversation
…ManyToMany relationship
…nstead of on `BlockTranslatedContent`
4a2ff99
to
e64223c
Compare
…esults into errors as the validator looks for translated content using the FKs
…ontent` relationship to `ForeignKey` - Update Block model to use ForeignKey for translated_contents - Modify migrations to reflect new relationship - Adjust admin interface to handle inline editing of translated contents - Update related queries and methods to use new relationship structure
@@ -112,29 +117,31 @@ class Block(models.Model): | |||
phase = models.ForeignKey(Phase, on_delete=models.CASCADE, related_name="blocks", blank=True, null=True) | |||
index = models.IntegerField(default=0, help_text="Index of the block in the phase. Lower numbers come first.") | |||
playlists = models.ManyToManyField("section.Playlist", blank=True) | |||
|
|||
# TODO: to be deleted? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this has been moved to BlockTranslatedContent
, I think we can remove these, indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering though: What will be the name of a Block that has no Translated Content? How should we display it in the form/list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, perhaps just the object name with id (which would be Django's default)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The __str__
method might also return something like Block with slug {slug}
perhaps?
…des fix for the tabular inline form's heading
This PR does the following:
BlockTranslatedContent
model with an FK toBlock
block
,language
,name
,description
Block
(like name & description) to aBlockTranslatedContent
with the same language as the block (or defaults to English)consent
,hashtag
,language
andurl
from the `Block model.name
anddescription
for now as it might be convenient for the experiment administrator. They aren't used by anything afaikdjango-nested-admin
whose fix is not yet released.Video of experiment form
Screen.Recording.2024-08-30.at.12.29.26.mov