json-sempai icon indicating copy to clipboard operation
json-sempai copied to clipboard

Auto eval code strings

Open lkraider opened this issue 8 years ago • 1 comments

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.

lkraider avatar Jan 26 '16 04:01 lkraider

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.

lkraider avatar Jan 27 '16 01:01 lkraider