Example #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))
Example #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)
Example #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)
Example #4
0
def remove(apikey, body):
    return buildResponse(deleteRow(__tablename, body))
Example #5
0
def modify(apikey, body):
    canmodify = [
        auth.canUserModifyEntity(auth.getProvidedUsername, x['id'])
        for x in body
    ]
    return buildResponse(modifyRows(__tablename, body))
Example #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)
Example #7
0
def check(apikey):
    args = locals()
    result = auth.getIDforEmail(auth.getProvidedUsername())
    return buildResponse(result)
Example #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)
Example #9
0
def modify(apikey, body):
    return buildResponse(modifyRows(__tablename, body))