Merge branch 'fix_issue_179' of https://github.com/rcommande/colander into rcommande-fix_issue_179
Conflicts: CHANGES.rst CONTRIBUTORS.txt
This commit is contained in:
@@ -21,6 +21,13 @@ Features
|
||||
- Add a ``missing_msg`` argument to ``SchemaNode`` that specifies the error
|
||||
message to be used when the node is required and missing
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
- Fix an issue where the ``flatten()`` method produces an invalid name
|
||||
(ex: "answer.0.") for the type "Sequence". See
|
||||
https://github.com/Pylons/colander/issues/179
|
||||
|
||||
|
||||
1.0 (2014-11-26)
|
||||
----------------
|
||||
|
@@ -121,6 +121,7 @@ Contributors
|
||||
- Cédric Messiant, 2014/06/27
|
||||
- Gouji Ochiai, 2014/08/21
|
||||
- Tim Tisdall, 2014/09/10
|
||||
- Romain Commandé, 2014/10/11
|
||||
- Nando Florestan, 2014/11/27
|
||||
- Amos Latteier, 2014/11/30
|
||||
- Jimmy Thrasibule, 2014/12/11
|
||||
|
@@ -506,7 +506,7 @@ class SchemaType(object):
|
||||
selfname = prefix
|
||||
else:
|
||||
selfname = '%s%s' % (prefix, node.name)
|
||||
result[selfname] = appstruct
|
||||
result[selfname.rstrip('.')] = appstruct
|
||||
return result
|
||||
|
||||
def unflatten(self, node, paths, fstruct):
|
||||
|
@@ -1375,6 +1375,16 @@ class TestSequence(unittest.TestCase):
|
||||
result = typ.flatten(node, [1, 2])
|
||||
self.assertEqual(result, {'node.0': 1, 'node.1': 2})
|
||||
|
||||
def test_flatten_with_integer(self):
|
||||
from colander import Integer
|
||||
node = DummySchemaNode(None, name='node')
|
||||
node.children = [
|
||||
DummySchemaNode(Integer(), name='foo'),
|
||||
]
|
||||
typ = self._makeOne()
|
||||
result = typ.flatten(node, [1, 2])
|
||||
self.assertEqual(result, {'node.0': 1, 'node.1': 2})
|
||||
|
||||
def test_flatten_listitem(self):
|
||||
node = DummySchemaNode(None, name='node')
|
||||
node.children = [
|
||||
|
Reference in New Issue
Block a user