Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #2, fix inter-field message extraction, add asdict2(), fix All() so it won't lose children exceptions #12

Closed
wants to merge 8 commits into from

Conversation

nandoflorestan
Copy link
Contributor

All with tests demonstrating the purpose of the edits.

Oh, and update the Brazilian Portuguese translation.

...and on next commit we fix it.
...but I have another test case (see next commit).
...don't need it to be interactive anymore.
...validation and message assignment.
asdict() returns one item per leaf of the exception graph.
That does not cover my use case, which is not unlike
http://deformdemo.repoze.org/interfield/

So asdict2() returns more items in the dictionary, allowing you to
place error messages in more places of your form.

Originally I intended to replace the behaviour of asdict(), but
in so doing I broke 4 other test cases, so I expect this kind of
change has to be made on a new API. Thus, asdict2().
This commit contains only the test, see next commit for the fix.
Also removed the funny but non functional Texas locale.
@mcdonc
Copy link
Member

mcdonc commented Jun 23, 2011

Sorry I didn't get to this for Colander 0.9.3 (just released). I'll review it for the next version.

@ravishi
Copy link

ravishi commented Jun 29, 2011

I had this same problem, and solved by replacing exc.msg and msgs.append(exc.msg) by exc.msg and msgs.extend(self.messages()). I think it's more cleaner. The only prob is that self.messages can return something like [None] and it'll break. But that can be easily fixed too.

Also, this requires some modifications on deform. I'll try to send you a patch later.

@nandoflorestan
Copy link
Contributor Author

I am OK with whatever implementation details as long as the tests I added pass...

@ravishi
Copy link

ravishi commented Oct 18, 2011

Is this going to be merged into 0.9.4? I didnt't send the stuff I commented before because it wasn't necessary. In the end my solution was very close to nando's one. I hope it gets included in 0.9.4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants