If the implementation is easy to explain, it may be a good idea.

There are no clean explaination about json.py,
After glancing the code I thlought json.py provide model->view mapper
(which is the controller's task, so in my opinion its not suite for
being included in view.py)


I just can't locate json.py in my mindmap(it's laid sqlobject-related
code only until now).
One reason is it's inconsistency syntax with other part of default
turbogears.

ex:

@jsonify.when('isinstance(obj, Group)')
def jsonify_group(obj):
    result = jsonify_sqlobject( obj )
    result["users"] = [u.user_name for u in obj.users]
    result["permissions"] = [p.permission_name for p in
obj.permissions]
    return result

It could be more familiar to people if we choose the same programming
style to return vars with dict()

@jsonify.when('isinstance(obj, Group)')
def jsonify_group(obj):
    result = jsonify_sqlobject( obj )
    return result.Dict(users = [u.user_name for u in obj.users],
permissions = [p.permission_name for p in obj.permissions])

not sure if it is equivalent, but you got my point



--
Fred


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to