Ejemplo n.º 1
0
def add(apikey, body):
    currentUser = getCurrentUser()
    print('current user is {cu}'.format(cu=currentUser))
    for thing in body:
        thing.update({'user': currentUser})
    print('body is {a}'.format(a=body))
    return buildResponse(addRows(__tablename, body))
Ejemplo n.º 2
0
def read(apikey,
         id='*',
         category=None,
         name=None,
         description=None,
         count=10,
         page=1,
         method='and'):
    args = locals()
    result = readRows(__tablename, args)
    return buildResponse(result)
Ejemplo n.º 3
0
def read(apikey,
         id='*',
         description=None,
         owner=None,
         _property=None,
         count=None,
         page=None,
         method='and'):
    args = locals()
    result = readRows(__tablename, args)
    return buildResponse(result)
Ejemplo n.º 4
0
def remove(apikey, body):
    return buildResponse(deleteRow(__tablename, body))
Ejemplo n.º 5
0
def modify(apikey, body):
    canmodify = [
        auth.canUserModifyEntity(auth.getProvidedUsername, x['id'])
        for x in body
    ]
    return buildResponse(modifyRows(__tablename, body))
Ejemplo n.º 6
0
def add(apikey, body):
    additions = addRows(__tablename, body)
    userID = auth.getIDforEmail(auth.getProvidedUsername())
    [auth.claimEntity(userID, x) for x in additions]
    return buildResponse(additions)
Ejemplo n.º 7
0
def check(apikey):
    args = locals()
    result = auth.getIDforEmail(auth.getProvidedUsername())
    return buildResponse(result)
Ejemplo n.º 8
0
def new(apikey):
    email = auth.getProvidedUsername()
    password = auth.getProvidedPassword()
    errors = {False: (9, 'User Already Exists')}
    return buildResponse(makeNewUser(email=email, newpass=password),
                         errors=errors)
Ejemplo n.º 9
0
def modify(apikey, body):
    return buildResponse(modifyRows(__tablename, body))