Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

[ENH] Custom Float Value Enhancements #86

Open
wants to merge 3 commits into
base: 10.0
Choose a base branch
from

Conversation

richard-willdooit
Copy link
Contributor

Allows float rounding to be defined.

Checks min and max better

js and xml for the configurator front end NOT changed!

Richard deMeester added 3 commits May 5, 2017 11:43
Allows float rounding to be defined.

Checks min and max better

I have not changed the js and xml for the configurator front end
NOT changed!
@codecov-io
Copy link

Codecov Report

Merging #86 into 10.0 will increase coverage by 0.61%.
The diff coverage is 52.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##             10.0      #86      +/-   ##
==========================================
+ Coverage   61.11%   61.72%   +0.61%     
==========================================
  Files          14       14              
  Lines        1368     1382      +14     
==========================================
+ Hits          836      853      +17     
+ Misses        532      529       -3
Impacted Files Coverage Δ
...configurator_wizard/wizard/product_configurator.py 32.98% <0%> (-0.26%) ⬇️
website_product_configurator/controllers/main.py 72.75% <0%> (-0.89%) ⬇️
product_configurator/models/product_attribute.py 61.6% <100%> (+11.13%) ⬆️
product_configurator/models/product.py 74.14% <0%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89750da...70783ba. Read the comment docs.

string="Max Float Value",
digits=(16, 4),
help="Maximum value allowed, or 0 if not checked"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we keep one float field for min/max of int and float since there can only be one custom field type per attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PCatinean True, but it needs to be a float min or max, not an integer. Our requirement was that the minimum was 0.573, and the maximum was 20.127 (a length).

I think this is a little cleaner, though, because it implies the validation steps are dependent on the type, which could be extended to other types at another time...

Also, if a float min is used, then we need to ensure the error converts the min to an integer before displaying so it does not say "Value cannot be greater than 20.0"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants