Ticket #5903: decimal-field-default.patch
File decimal-field-default.patch, 750 bytes (added by , 17 years ago) |
---|
-
__init__.py
663 663 num_chars += 1 664 664 665 665 return u"%.*f" % (self.decimal_places, value) 666 667 def get_default(self): 668 "Returns the default value for this field." 669 if self.default is not NOT_PROVIDED: 670 if callable(self.default): 671 return self.to_python(self.default()) 672 return self.to_python(self.default) 673 if not self.empty_strings_allowed or (self.null and settings.DATABASE_ENGINE != 'oracle'): 674 return None 675 return "" 666 676 667 677 def get_db_prep_save(self, value): 668 678 if value is not None: