-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
Migrate Calculations to DX #2600
base: 2.x
Are you sure you want to change the base?
Conversation
Excellent work @toropok and @Bugerman58 🥇 . I can imagine how challenging the migration of Calculation has been!. Your amazing work is really appreciated! Willing to review the Pull Request already and maybe we open another one later for the removal of the |
Hi @toropok , tests are failing https://github.com/senaite/senaite.core/actions/runs/11948903328/job/33307294669 Can you please take a look before I start to review? |
Hi @xispa Sure, I'll fix the failed Python tests (they only test object validation) and get back to you. The remaining failing tests are doctests, which are related to HistoryAwareReferenceField. |
Sorry for the long pause.
That leaves us with two remaining issues that need your guidance and vision:
|
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.
Pheew, a lot of work here... @toropok you must be exhausted. I've done a first review and requested some changes though.
Haven't gone through the validators details yet, but I think you can simplify a lot there. I feel are overwhelming, will review them in the next round.
I've seen tests that are failing are because of the HistoryAwareReferenceField
. Don't worry too much about this for now.
src/senaite/core/browser/viewlets/templates/calculation_edit.pt
Outdated
Show resolved
Hide resolved
Yes, I've seen. I've requested some changes, we will handle this
They are supposed to work, yes. For instance, if the user types this formula: [CHOL] + [FAT] if [CHOL] >= [CHOL.LDL] else "Invalid" where:
Therefore, if the result of See e.g. the doctests here: https://github.com/senaite/senaite.core/blob/2.x/src/senaite/core/tests/test_calculations.py#L83-L137 |
Yeah, I see now. But it's never worked before for calculating test results with wildcards used at least |
Description of the issue/feature this PR addresses
This PR migrates the AT Calculation to Dexterity for Python 3 compatibility.
Current behavior before PR
Calculation is a content type based on the Archetypes framework
Desired behavior after PR is merged
Calculation is a content type based on the Dexterity framework
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.