예제 #1
0
def create():
    inp.register_request(request)
    inp.set_rules(model.Friend.validation_rules)
    valid, op = inp.validate()
    
    return out({"validation" : op, 'valid' : valid, 'data' : inp.post()})
    
    if valid is True:
        return out({"validation" : op, 'valid' : valid, 'data' : inp.post()})
    else:
        return err({"validation" : op, 'valid' : valid, 'data' : inp.post()})
예제 #2
0
def email():
    resp = sendmail(to = ['*****@*****.**'], 
                    body = {"header" : "1233"}, 
                    subject = "mail test",
                    template="template2")
    
    return out(resp)
예제 #3
0
def devas():
    inp.register_request(request, copyheader=['Header-One', 'Header-Two'])
#     d = request.get_json()
#     print(request.headers.get('Content-Type'))
#     inp.set_rules(model.Friend.validation_rules)
#     valid, op = inp.validate()
    
    return out({'data' : inp.post()})
예제 #4
0
def partvalidate():
    inp.register_request(request)
    inp.set_rules(model.Friend.validation_rules, ['field1', 'field2'])
    valid, op = inp.validate()
    
    
    inp.set_rules(model.Friend.validation_rules2, ['f1', 'f2'])
    valid, op = inp.validate()
    
    
    return out({"validation" : op, 'valid' : valid, 'data' : inp.post()})
예제 #5
0
def restclient():
    from core import restclient as rc
    url = 'http://192.168.5.63:5050/abc/ui'
    url = 'http://stage-cartapi.sastasundar.com/index.php/payment/genu_payment_process/app_payment_processing'
    url = 'http://192.168.5.69:4040/search/service/search?q=blood'
    authdata = {
        'type' : 'basic',
        'username' : 'admin',
        'password' : '1234' 
    }
    
    cont, req = rc.get(url, data = {'q' : 'dettol', "sdf" : 5656}, headers={'qq' : "67"}, authdata=authdata)
    return out(cont)
예제 #6
0
def posti():
    inp.register_request(request)
    return out({"data" : inp.post()})
예제 #7
0
def testdel(id):
    inp.register_request(request)
    print(inp.post(), id)
    return out(inp.post())
예제 #8
0
def ui():
    inp.register_request(request)
    data = inp.post()
    
    return out({"body" : data, "head" : inp.headers()}, msg='successfully', status=2000)
예제 #9
0
def list():
    inp.register_request(request)
    if request.method == 'POST':
        return out({'body' : inp.post(), 'head' : dict(request.headers)})
    else:
        return out({'body' : inp.get(), 'head' : dict(request.headers)})
예제 #10
0
def memory1():
    x = y = 4
    z = 5
    return out({"body" : hex(id(z)) }, msg='successfully', status=2000)
    #