Ticket #16570: 16570-3.diff

File 16570-3.diff, 3.6 KB (added by kenth, 13 years ago)

Updated patch to account for refactoring in #16681

  • AUTHORS

    diff --git a/AUTHORS b/AUTHORS
    index b64a627..3e4d185 100644
    a b answer newbie questions, and generally made Django that much better:  
    525525    wam-djangobug@wamber.net
    526526    Wang Chun <wangchun@exoweb.net>
    527527    Filip Wasilewski <filip.wasilewski@gmail.com>
    528     Dan Watson <http://theidioteque.net/>
     528    Dan Watson <http://danwatson.net/>
    529529    Joel Watts <joel@joelwatts.com>
    530530    Lakin Wecker <lakin@structuredabstraction.com>
    531531    Chris Wesseling <Chris.Wesseling@cwi.nl>
  • django/core/management/validation.py

    diff --git a/django/core/management/validation.py b/django/core/management/validation.py
    index 3cb2e34..3aaeaa9 100644
    a b def get_validation_errors(outfile, app=None):  
    7272                        mdigits_ok = True
    7373                except (ValueError, TypeError):
    7474                    e.add(opts, mdigits_msg % f.name)
    75                 invalid_values_msg = '"%s": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.'
     75                invalid_values_msg = '"%s": DecimalFields require a "max_digits" attribute value that is greater than or equal to the value of the "decimal_places" attribute.'
    7676                if decimalp_ok and mdigits_ok:
    77                     if decimal_places >= max_digits:
     77                    if decimal_places > max_digits:
    7878                        e.add(opts, invalid_values_msg % f.name)
    7979            if isinstance(f, models.FileField) and not f.upload_to:
    8080                e.add(opts, '"%s": FileFields require an "upload_to" attribute.' % f.name)
  • docs/ref/models/fields.txt

    diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
    index a5d66f8..e0cf92f 100644
    a b A fixed-precision decimal number, represented in Python by a  
    450450.. attribute:: DecimalField.max_digits
    451451
    452452    The maximum number of digits allowed in the number. Note that this number
    453     must be greater than ``decimal_places``, if it exists.
     453    must be greater than or equal to ``decimal_places``, if it exists.
    454454
    455455.. attribute:: DecimalField.decimal_places
    456456
  • tests/modeltests/invalid_models/invalid_models/models.py

    diff --git a/tests/modeltests/invalid_models/invalid_models/models.py b/tests/modeltests/invalid_models/invalid_models/models.py
    index 422d70f..93c1c66 100644
    a b invalid_models.fielderrors: "decimalfield2": DecimalFields require a "decimal_pl  
    243243invalid_models.fielderrors: "decimalfield2": DecimalFields require a "max_digits" attribute that is a positive integer.
    244244invalid_models.fielderrors: "decimalfield3": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
    245245invalid_models.fielderrors: "decimalfield3": DecimalFields require a "max_digits" attribute that is a positive integer.
    246 invalid_models.fielderrors: "decimalfield4": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
    247 invalid_models.fielderrors: "decimalfield5": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
     246invalid_models.fielderrors: "decimalfield4": DecimalFields require a "max_digits" attribute value that is greater than or equal to the value of the "decimal_places" attribute.
    248247invalid_models.fielderrors: "filefield": FileFields require an "upload_to" attribute.
    249248invalid_models.fielderrors: "choices": "choices" should be iterable (e.g., a tuple or list).
    250249invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
Back to Top