Comments (4)
On the other hand, in the Form field the app expects integers between 0 and 100 for percent_of_ownership
and, on Task save, the data does not seem to be transformed to the database expected format for share_ratio
.
That's why setting a percent_of_ownership
to 0 or 1 or 9 works, while 10, 11, 99 raises <class 'decimal.InvalidOperation'>
when trying to save data about Owned Buildings.
from asset-declarations.
Great point @danniel
The way I see it the share_ratio should be in the form of 33.5 -> meaning 33.5%.
One way to implement this would be to implement a factory of model fields, that get as input just the name of the field. For example in our case, have a factory method that returns share_ratio type of fields, with 'max_digits=3' and 'decimal_places=1'.
from asset-declarations.
This is great digging and a great summary of the issue!
On the other hand, it occurs to me, reading this, that there might be people who have filled the asset declaration form in with a percent of 89.78
. I hope this isn't the case, but what if it is?
Regardless, I think we should address this issue as part of the refactoring needed to merge this PR.
What do you think?
from asset-declarations.
I will make all three fields to be max_digits=5, decimal_places=2
This way we can allow values as 100.00 for (100%)
A custom validator will prevent the input of values over 100.00
from asset-declarations.
Related Issues (20)
- Add "valoare impozabilă" to "Owned Buildings" HOT 1
- Missing information for "titular" (owner) HOT 2
- Re-arrange Owned Land Template HOT 1
- OwnedIncomeFromOtherSources mismatch between model and task
- Model-task mismatches: Cannot resolve keyword 'person' into field. HOT 1
- Missing child classes - TaskTranscribeOwnedInvestmentsTable & TaskOwnedIncomeFromIndependentActivitiesTable HOT 2
- [Infrastructure] Docker container for running PyBossa HOT 2
- [Infrastructure] Docker container running the catpol-declaratii solution
- [Infrastructure] Integrate catpol-declaratii solution with PyBossa instance HOT 2
- [Infrastructure] Automatic deployment of catpol-declaratii solution HOT 1
- The forms' year choices values are only computed at server start HOT 2
- Possible static attribute issue HOT 3
- Localization changes form type
- [frontend] Create navigation bar
- [frontend] Add footer
- [frontend] Create SVG logo
- [frontend] [UX] Intermediary preview of the data that a user has filled in HOT 2
- [critical] Modify Asset Declarations to use the new version of Moonsheep HOT 2
- [DevOps] The GitHub Actions workflow should call docker-compose HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asset-declarations.