Changes between Initial Version and Version 1 of Ticket #28562, comment 6


Ignore:
Timestamp:
Jan 26, 2018, 10:50:12 AM (6 years ago)
Author:
Josh Harwood

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28562, comment 6

    initial v1  
    55{{{
    66class UpdateBalanceForm(forms.Form):
    7     id = forms.ModelChoiceField(ProductPortfolio.objects.all(), required=True)
    87    balance = forms.DecimalField(decimal_places=2, max_digits=16, required=True)
    98}}}
     
    1211
    1312{{{
    14 form = UpdateBalanceForm({'id':1, 'balance':Decimal('5.420575188741E-12')})
     13form = UpdateBalanceForm({'balance':Decimal('5.420575188741E-12')})
    1514form.is_valid()
    1615False
    1716form.errors
    18 {'id': ['Select a valid choice. That choice is not one of the available choices.'], 'balance': ['Ensure that there are no more than 16 digits in total.']}
     17{'balance': ['Ensure that there are no more than 16 digits in total.']}
    1918}}}
    2019
    2120This is surprising because the value has 13 digits minus the scientific notation
     21
     22edit 1: Simplified example
Back to Top