-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
Refactor: BaseInvenTreeSetting #4834
Conversation
@wolflu05 are you sure that the subclass checking is not required for plugin settings? Edit: It seems there is no coverage on the changed settings code - that would need to be changed |
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.
Looks good in general
I used project wide code search and checked all method calls individually where I changed something if there is a |
So we can remove that section entirely? |
What section? The subclass checking in the BaseInventreeSettingClass? Yes. Ideally everything is moved out now and should be implemented in new code like this. Do you want me to add general tests in this PR? But how do we test an abstract model? |
How do I interpret the coverage report? Especially this line? Should there something be improved? And where is the coverage decrease in this file? |
Something seems off with the coverage - I will let it run again |
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.
Looks good but not sure if the uniqueness will work this way
How do you mean that? |
I was worried about removing the kwargs passed to the uniqueness check for user settings, in local testing it seems to work this way though. |
@SchrodingersGat 0.12.0 is looking like a big change under the hood - I think especially this one needs a bit of testing in the real world before we release a stable |
This PR tries to add typings for settings and make the
common.BaseInvenTreeSetting
model more generic. This simplifies the implementation for the #4824 , see #4824 (comment)Actually first, I planned to only add a
get_filters
method like theget_kwargs
method until I now discovered that something like this was already there onetime and was removed. (See: 5ee9af7). Let me know if you have a better idea to make it more generic.I tested this and discovered no bugs or issues that something doesnt work or break with this PR. Hopefully tests cover the other half 😄.