Skip to content

Commit

Permalink
the order of fields matter when setting the error message on ObjectWi…
Browse files Browse the repository at this point in the history
…dget
  • Loading branch information
agroszer committed Feb 20, 2016
1 parent c7ccba1 commit c6991bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/z3c/form/browser/object_multi_integration.txt
Expand Up @@ -315,7 +315,7 @@ for "foo\nbar" and a new input.
Object label
*
<BLANKLINE>
Constraint not satisfied
The entered value is not a valid integer literal.
<BLANKLINE>
[ ]
Int label
Expand Down Expand Up @@ -349,7 +349,7 @@ Submit again with the empty field:
>>> content = getForm(request, 'ObjectMulti_list_edit_submit_textline_again.html')
>>> print(testing.plainText(content,
... './/div[@id="form-widgets-listOfObject-0-row"]//div[@class="error"]'))
Constraint not satisfied
The entered value is not a valid integer literal.
The entered value is not a valid integer literal.
Constraint not satisfied

Expand All @@ -374,7 +374,7 @@ Let's remove some items:
<BLANKLINE>
Object label
*
Constraint not satisfied
The entered value is not a valid integer literal.
[ ]
Int label
*
Expand Down Expand Up @@ -443,7 +443,7 @@ for "foobar" and a new input.
<BLANKLINE>
Object label
*
The datetime string did not match the pattern u'yy/MM/dd'.
The entered value is not a valid integer literal.
[ ]
Int label
*
Expand Down Expand Up @@ -503,7 +503,7 @@ Submit again with the empty field:
>>> content = getForm(request)
>>> print(testing.plainText(content,
... './/div[@id="form-widgets-listOfObject-0-row"]//div[@class="error"]'))
The datetime string did not match the pattern 'yy/MM/dd'.
The entered value is not a valid integer literal.
The entered value is not a valid integer literal.
Constraint not satisfied
The datetime string did not match the pattern 'yy/MM/dd'.
Expand All @@ -526,7 +526,7 @@ And fill in a valid value:
<BLANKLINE>
Object label
*
The datetime string did not match the pattern 'yy/MM/dd'.
The entered value is not a valid integer literal.
[ ]
Int label
*
Expand Down Expand Up @@ -625,7 +625,7 @@ Let's remove some items:
<BLANKLINE>
Object label
*
The datetime string did not match the pattern 'yy/MM/dd'.
The entered value is not a valid integer literal.
[ ]
Int label
*
Expand Down
4 changes: 2 additions & 2 deletions src/z3c/form/object.py
Expand Up @@ -62,7 +62,7 @@ def toWidgetValue(self, value):
retval = ObjectWidgetValue()
retval.originalValue = value

for name in zope.schema.getFieldNames(self.field.schema):
for name in zope.schema.getFieldNamesInOrder(self.field.schema):
field = self.field.schema[name]

dm = zope.component.getMultiAdapter(
Expand Down Expand Up @@ -144,7 +144,7 @@ def toFieldValue(self, value):
obj = self.adapted_obj(obj)

names = []
for name in zope.schema.getFieldNames(self.field.schema):
for name in zope.schema.getFieldNamesInOrder(self.field.schema):
field = self.field.schema[name]
if not field.readonly:
try:
Expand Down

0 comments on commit c6991bd

Please sign in to comment.