Ticket #4415: 4415_fields.diff
File 4415_fields.diff, 1.0 KB (added by , 17 years ago) |
---|
-
django/db/models/fields/__init__.py
910 910 class PositiveIntegerField(IntegerField): 911 911 def get_manipulator_field_objs(self): 912 912 return [oldforms.PositiveIntegerField] 913 914 def formfield(self, **kwargs): 915 defaults = {'min_value': 0} 916 defaults.update(kwargs) 917 return super(PositiveIntegerField, self).formfield(**defaults) 913 918 914 919 class PositiveSmallIntegerField(IntegerField): 915 920 def get_manipulator_field_objs(self): 916 921 return [oldforms.PositiveSmallIntegerField] 917 922 923 def formfield(self, **kwargs): 924 defaults = {'min_value': 0} 925 defaults.update(kwargs) 926 return super(PositiveSmallIntegerField, self).formfield(**defaults) 927 918 928 class SlugField(CharField): 919 929 def __init__(self, *args, **kwargs): 920 930 kwargs['max_length'] = kwargs.get('max_length', 50)