1
0
mirror of https://github.com/django/django.git synced 2024-12-23 09:36:06 +00:00

newforms: Simplified BoundField._errors()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-12-07 05:19:01 +00:00
parent 9a02d668c1
commit 558e07a9bc

View File

@ -179,10 +179,7 @@ class BoundField(StrAndUnicode):
Returns an ErrorList for this field. Returns an empty ErrorList Returns an ErrorList for this field. Returns an empty ErrorList
if there are none. if there are none.
""" """
try: return self.form.errors.get(self.name, ErrorList())
return self.form.errors[self.name]
except KeyError:
return ErrorList()
errors = property(_errors) errors = property(_errors)
def as_widget(self, widget, attrs=None): def as_widget(self, widget, attrs=None):