Ticket #1477: urlfield_maxlength.diff

File urlfield_maxlength.diff, 816 bytes (added by Julien Poissonnier <poissonnier@…>, 9 years ago)

add maxlength argument to URLField

  • django/forms/__init__.py

     
    834834
    835835class URLField(TextField):
    836836    "A convenience FormField for validating URLs"
    837     def __init__(self, field_name, length=50, is_required=False, validator_list=[]):
     837    def __init__(self, field_name, length=50, maxlength=200, is_required=False, validator_list=[]):
    838838        validator_list = [self.isValidURL] + validator_list
    839         TextField.__init__(self, field_name, length=length, maxlength=200,
     839        TextField.__init__(self, field_name, length=length, maxlength=maxlength,
    840840            is_required=is_required, validator_list=validator_list)
    841841
    842842    def isValidURL(self, field_data, all_data):
Back to Top