Closed remiberthoz closed 3 years ago
Sorry I don't know why it says I closed the PR... I forced-push on my master branch after rebasing on top of your master branch and resolving conflicts. I am normally two commits ahead.
@remiberthoz I pushed one quick change to your PR to avoid potentially breaking API compatibility, and it looks good to merge :smile: Will merge it momentarily once the CI tests pass.
One note is that we need to add tests that exercise this functionality. I can do that in the next few days or if you want to take it on, just comment here to let me know so we don't duplicate work.
Hey, I will write the tests!
What behaviors would you like to test against? Of course, that the sorting index actually sorts when its used. Do you have edge-cases in mind?
@remiberthoz I think a simple "happy path" test case would be fine for this feature, just to make sure nobody accidentally breaks it in the future.
It is now possible to define a
sort_field
value for notes by setting asort_field_number
when creating the model. When thesort_field
argument is unused upon note creation, then the field corresponding to the modelssort_field_number
will be used. The default value is1
(for first field).The changes are compatible with previous versions.