Ticket #5931: db_models_fields_repr.diff
File db_models_fields_repr.diff, 1.1 KB (added by , 17 years ago) |
---|
-
tests/regressiontests/model_fields/tests.py
15 15 Traceback (most recent call last): 16 16 ... 17 17 ValidationError: [u'This value must be a decimal number.'] 18 19 >>> repr(f) 20 '<django.db.models.fields.DecimalField None>' 18 21 """ -
django/db/models/fields/__init__.py
402 402 "Returns the value of this field in the given model instance." 403 403 return getattr(obj, self.attname) 404 404 405 def __repr__(self): 406 "Display the name of the field, too. Usefull for debugging." 407 return '<%s.%s %s>' % (self.__class__.__module__, self.__class__.__name__, getattr(self, "name", None)) 408 405 409 class AutoField(Field): 406 410 empty_strings_allowed = False 407 411 def __init__(self, *args, **kwargs):