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:
parent
9a02d668c1
commit
558e07a9bc
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user