Ticket #3557: slugfield.patch
File slugfield.patch, 1.0 KB (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
758 758 def get_manipulator_field_objs(self): 759 759 return [oldforms.PositiveSmallIntegerField] 760 760 761 class SlugField( Field):761 class SlugField(CharField): 762 762 def __init__(self, *args, **kwargs): 763 763 kwargs['maxlength'] = kwargs.get('maxlength', 50) 764 764 kwargs.setdefault('validator_list', []).append(validators.isSlug) 765 765 # Set db_index=True unless it's been set manually. 766 766 if not kwargs.has_key('db_index'): 767 767 kwargs['db_index'] = True 768 Field.__init__(self, *args, **kwargs)768 CharField.__init__(self, *args, **kwargs) 769 769 770 def get_manipulator_field_objs(self):771 return [oldforms.TextField]772 773 770 class SmallIntegerField(IntegerField): 774 771 def get_manipulator_field_objs(self): 775 772 return [oldforms.SmallIntegerField]