json-sempai
json-sempai copied to clipboard
Auto eval code strings
In my production server I keep needing to do:
def crud_handler():
request = __import__('user_posted_json')
eval(request.method)(db_connection, request.args)
Please consider allowing this syntax so my code looks cleaner:
def crud_handler():
request = __import__('user_posted_json')
request.method(db_connection, request.args)
I think adding a __call__
method on DottedDict that wraps eval should do it.
Ok, so I waited 20+ hours for a fix here and finally gave up on waiting and did it myself. Please merge #25 so I can close this long standing issue at last.