google-code-export / dojango

Automatically exported from code.google.com/p/dojango
Other
1 stars 0 forks source link

Widget.max_digits is ignored by Dojango. #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create django form that contains DecimalField with max_digits set o X.
2. Open page in a browser
3. Try to inset more than X digits into that field.

What is the expected output? What do you see instead?
Dojango should display warning message or prevent from inserting more digits, 
but nothing like that happens.

What version of the product are you using? On what operating system?
Django 1.3, Dojango trunk.

Please provide any additional information below.

Here is the cause:

class DojoWidgetMixin:
    default_field_attr_map = { # the default map for mapping field attributes to dojo attributes
        'required':'required',
        'help_text':'promptMessage',
        'min_value':'constraints.min',
        'max_value':'constraints.max',
        'max_length':'maxLength',
        #'max_digits':'maxDigits',
        'decimal_places':'constraints.places',
        'js_regex':'regExp',
        'multiple':'multiple',
    }

Original issue reported on code.google.com by zim...@gmail.com on 11 May 2011 at 12:59

GoogleCodeExporter commented 9 years ago
Fixed in 
https://github.com/klipstein/dojango/commit/1f0492073b3ecb6b3d1a00979009626052e2
3d90

Original comment by tobias.k...@googlemail.com on 6 Nov 2011 at 9:42