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))
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)
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)
def remove(apikey, body): return buildResponse(deleteRow(__tablename, body))
def modify(apikey, body): canmodify = [ auth.canUserModifyEntity(auth.getProvidedUsername, x['id']) for x in body ] return buildResponse(modifyRows(__tablename, body))
def add(apikey, body): additions = addRows(__tablename, body) userID = auth.getIDforEmail(auth.getProvidedUsername()) [auth.claimEntity(userID, x) for x in additions] return buildResponse(additions)
def check(apikey): args = locals() result = auth.getIDforEmail(auth.getProvidedUsername()) return buildResponse(result)
def new(apikey): email = auth.getProvidedUsername() password = auth.getProvidedPassword() errors = {False: (9, 'User Already Exists')} return buildResponse(makeNewUser(email=email, newpass=password), errors=errors)
def modify(apikey, body): return buildResponse(modifyRows(__tablename, body))