Ticket #17870: Ticket17870-2.patch

File Ticket17870-2.patch, 1.3 KB (added by Joe Tennies, 13 years ago)

Updated to RKM's wording

  • django/db/models/fields/__init__.py

    diff -r c8373c5e600e django/db/models/fields/__init__.py
    a b  
    890890    description = _("E-mail address")
    891891
    892892    def __init__(self, *args, **kwargs):
     893        # max_length should be overridden to 254 characters to be fully
     894        # compliant with RFCs 3696 and 5321
     895
    893896        kwargs['max_length'] = kwargs.get('max_length', 75)
    894897        CharField.__init__(self, *args, **kwargs)
    895898
  • docs/ref/models/fields.txt

    diff -r c8373c5e600e docs/ref/models/fields.txt
    a b  
    481481
    482482A :class:`CharField` that checks that the value is a valid email address.
    483483
     484.. admonition:: Incompliance to RFCs
     485
     486    The default 75 character ``max_length`` is not capable of storing all
     487    possible RFC3696/5321-compliant email addresses. In order to store all
     488    possible valid email addresses, a ``max_length`` of 254 is required.
     489    The default ``max_length`` of 75 exists for historical reasons. The
     490    default has not been changed in order to maintain backwards
     491    compatibility with existing uses of :class:`EmailField`.
     492
    484493``FileField``
    485494-------------
    486495
Back to Top