-
-
Notifications
You must be signed in to change notification settings - Fork 547
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
Split exercises from translations #448
Comments
Yeah, the current solution is anything but elegant. I'm currently getting the project and the dependencies up-to-date again, but I'm open to changing this |
My team will work on this thank you! |
I've been thinking, since the exercise model is referenced in so many places, it might be easier to leave exercise just be and add an ExerciseBase, then use that one when necessary. This also has the advantage that e.g. the exercise URLs will stay the same |
@rolandgeider Could you elaborate on the proposed ExerciseBase model? What information would it include? Also, would each of the existing Exercise models be associated to its corresponding ExerciseBase? Thanks! |
Sure. I meant that instead of splitting the exercise models into an exercise and an exerciseTranslatable like 12people suggested, we "flip" it. The exercise model would contain the language specific data, and reference a new ExerciseBase with the common fields (category, equipment, etc.). The migration would look something like this:
|
Thanks so much for the clarification! I don't think any of us are fluent in German so that list would be greatly appreciated. |
I played a bit around with the REST API and I have the following notes:
Just my initial thoughts. 🤔 |
Hi @oliexdev , DELETE is allowed, I'm not sure about PATCH, but I haven't explicitly disallowed it (or at least don't remember doing that). There is a separate /exerciseinfo endpoint where the child models are returned as well (it's probably not clear that this exists) And as for new exercises being too similar, there's already #551 for that :) |
@rolandgeider If I try the DELETE operation I get Indeed I thought you need the excercise id for the exerciseinfo endpoint. Could you tell me what the UUID for? Is that an unique identifier for each exercise? Who and when is this generated? In some description of an exercise there are HTML tags included, would be good if they would deleted before they stored in the database. The formatting should be done afterwards. |
Sorry I had somehow missed your answer. The UUID is just an ID that is used to uniquely identify the exercises, e.g. during databas migrations as it is possible that local instances have deleted or added their own exercises. The UUID is automatically generated during creation. And as for the formatting, yes, that is not ideal. I had also thought of using markdown or such, but for the moment that works. Before saving this HTML, it is passed through bleach, which only allows tags from a whitelist |
Just merged the PR that split the translations. At the moment all the (REST) APIs have stayed the same, so the next steps will be to actually make translations easier |
@rolandgeider thanks for your answer could you verify if the DELETE operation works for you? Either I am doing something wrong or it is still not allowed. |
It is actually not allowed, just checked. To avoid confusion I have changed it so that it doesn't say it supports it (but this is obviously a TODO for the future) |
As it stands, each exercise item is tied to a specific language.
That leads to several issues:
Suggested fix:
Split translatable data from the exercise data type.
As such, the new object model could look like this:
The text was updated successfully, but these errors were encountered: