[Grok-dev] Re: the JSON work

Martijn Faassen faassen at startifact.com
Mon Apr 16 14:32:42 EDT 2007


Martijn Faassen wrote:
> Tim wrote:
>>> I saw Tim (already a while ago) checked in tests for the json support
>>> branch. This is great! Tim, can you report on the status of the branch
>>> now? I'd like to get it merged if possible.
>>
>> It works and the tests pass. But the question is if you think there 
>> are enough tests and the approach is a little better than awful  :)
> 
> I already took a peek at the approach before, but I will look again and 
> actually try a few things. I also hope at least one other person else 
> will do a review. (easy for beginning contributors! check out the branch 
> and try to do get some JSON views going).

Okay, I've just reviewed and merge this branch. Thanks again for doing 
this work, Tim!

I have left the basic approach untouched. Much simpler than what I ended 
up in, so my compliments for seeing the path where I couldn't! I've made 
some modifications:

* I've added simplejson as a requirement for grok to setup.py. This 
means that a grok buildout pulls it in automatically from the cheeseshop.

* I've added some tests for the security situation. It all worked, I 
just wanted to make sure we had good coverage.

* Then I noticed that the security-related code in the view grokker, the 
XMLRPC grokker and the JSON grokker had significant overlaps. I've 
refactored matters so they share code.

* While doing this, I discovered some omissions in the XMLRPC code (and 
JSON code). While the View code checks whether permissions exist and 
fails with a GrokError if not, the XMLRPC code did not. I've added this 
to the XMLRPC code and extended the test coverage.

Regards,

Martijn



More information about the Grok-dev mailing list