#11595: Fixture validation errors should report their data -------------------------------------+------------------------------------- Reporter: freyley | Owner: nobody Type: | Status: new Cleanup/optimization | Component: Core (Serialization) Milestone: | Severity: Normal Version: 1.0 | Keywords: easy-pickings Resolution: | Has patch: 0 Triage Stage: Accepted | Needs tests: 0 Needs documentation: 0 | Patch needs improvement: 0 | -------------------------------------+------------------------------------- Changes (by julien):
* keywords: => easy-pickings * type: => Cleanup/optimization * severity: => Normal Old description: > For example, here's what django/db/models/fields/__init__.py has for > lines 341-348: > > def to_python(self, value): > if value is None: > return value > try: > return int(value) > except (TypeError, ValueError): > raise exceptions.ValidationError( > _("This value must be an integer.") ) > > Changing line 348 to: > > _("(%s) must be an integer." % value) ) > > means that when you convert a text field to a joined object, you know > which one's broken where. (Other places in that file do the same thing) New description: For example, here's what django/db/models/fields/__init__.py has for lines 341-348: def to_python(self, value): if value is None: return value try: return int(value) except (TypeError, ValueError): raise exceptions.ValidationError( _("This value must be an integer.") ) Changing line 348 to: _("(%s) must be an integer." % value) ) means that when you convert a text field to a joined object, you know which one's broken where. (Other places in that file do the same thing) -- -- Ticket URL: <http://code.djangoproject.com/ticket/11595#comment:2> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.