Ticket #1665: fields.py.diff

File fields.py.diff, 1.3 KB (added by robert.morris@…, 19 years ago)
  • fields.py

     
    107107        core=False, rel=None, default=NOT_PROVIDED, editable=True,
    108108        prepopulate_from=None, unique_for_date=None, unique_for_month=None,
    109109        unique_for_year=None, validator_list=None, choices=None, radio_admin=None,
    110         help_text='', db_column=None):
     110        help_text='', db_column=None, length=None):
    111111        self.name = name
    112112        self.verbose_name = verbose_name or (name and name.replace('_', ' '))
    113113        self.primary_key = primary_key
    114114        self.maxlength, self.unique = maxlength, unique
     115        self.length = length
    115116        self.blank, self.null = blank, null
    116117        self.core, self.rel, self.default = core, rel, default
    117118        self.editable = editable
     
    222223        params = {'validator_list': self.validator_list[:]}
    223224        if self.maxlength and not self.choices: # Don't give SelectFields a maxlength parameter.
    224225            params['maxlength'] = self.maxlength
     226        if self.length:
     227            params['length'] = self.length
    225228        if isinstance(self.rel, ManyToOneRel):
    226229            params['member_name'] = name_prefix + self.attname
    227230            if self.rel.raw_id_admin:
Back to Top