Ticket #13761: orokusaki_db.models.fields.patch

File orokusaki_db.models.fields.patch, 1.5 KB (added by Oroku Saki, 14 years ago)

Might need to switch direction of min_length / max_length, etc but it's a start.

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

     
    7373    description = property(_description)
    7474
    7575    def __init__(self, verbose_name=None, name=None, primary_key=False,
    76             max_length=None, unique=False, blank=False, null=False,
     76            max_length=None, min_length=None, unique=False, blank=False, null=False,
    7777            db_index=False, rel=None, default=NOT_PROVIDED, editable=True,
    7878            serialize=True, unique_for_date=None, unique_for_month=None,
    7979            unique_for_year=None, choices=None, help_text='', db_column=None,
     
    8282        self.name = name
    8383        self.verbose_name = verbose_name
    8484        self.primary_key = primary_key
    85         self.max_length, self._unique = max_length, unique
     85        self.max_length, self.min_length, self._unique = max_length, min_length, unique
    8686        self.blank, self.null = blank, null
    8787        # Oracle treats the empty string ('') as null, so coerce the null
    8888        # option whenever '' is a possible value.
     
    541541    def __init__(self, *args, **kwargs):
    542542        super(CharField, self).__init__(*args, **kwargs)
    543543        self.validators.append(validators.MaxLengthValidator(self.max_length))
     544        self.validators.append(validators.MinLengthValidator(self.min_length))
    544545
    545546    def get_internal_type(self):
    546547        return "CharField"
Back to Top