def newClient():
    if not request.json or not 'email' in request.json or not 'pass' in request.json:
        abort(400)
    email = request.json['email']
    password = request.json['pass']
    client = Clients(email=email,
                     password=password,
                     carts=[],
                     address=request.json.get('address', ),
                     phone=request.json.get('phone', ),
                     id=email)
    client.put()
    memcache.flush_all()
    return make_response(jsonify({'created': client.key.id()}), 201)
示例#2
0
def newClient():
        if not request.json or not 'email' in request.json or not 'pass' in request.json:
                abort(400)
        email = request.json['email']
        password = request.json['pass']
        client = Clients(
                email = email,
                password = password,
                carts = [],
                address = request.json.get('address', ),
                phone = request.json.get('phone', ),
                id = email)
        client.put()
        memcache.flush_all()
        return make_response(jsonify({'created':client.key.id()}), 201)
示例#3
0
def newClient():
    if not request.json or not "email" in request.json or not "pass" in request.json:
        abort(400)
    email = request.json["email"]
    password = request.json["pass"]
    client = Clients(
        email=email,
        password=password,
        carts=[],
        address=request.json.get("address"),
        phone=request.json.get("phone"),
        id=email,
    )
    client.put()
    memcache.flush_all()
    return make_response(jsonify({"created": client.key.id()}), 201)
def getClients():
    return make_response(jsonify({'clients': Clients.getName()}), 200)
def deleteClients():
    for client in Clients.query():
        client.key.delete()
    return make_response('deleted')
示例#6
0
def deleteClients():
        for client in Clients.query():
                client.key.delete()
        return make_response('deleted')
示例#7
0
def getClients():
        return make_response(jsonify({'clients':Clients.getName()}), 200)