// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
var methodMap = {
'create': 'POST',
'update': 'PUT',
'patch': 'PATCH',
'delete': 'DELETE',
'read': 'GET'
};
@request.restful()
def object():
def GET(*args, **vars):
from gluon.serializers import json
....
def PATCH(*args, **vars):
'''
PATCH
update only a few properties of one object
'''
if request.args(0):
old_record = table[getAccess(True)]
....
The problem is probably that in your PATCH function you're accessing request.args(0) when you should be using args[0].
For further help you need to examine the error message you're getting as calling your PATCH is raising TypeError exceptions which usually means something isn't getting the correct arguments.
@request.restful()
def page():
def PATCH(*args, **vars):
if args[0]:
print 'PATCH args: ', args
def PUT(*args, **vars):
if request.args(0):
print request.args(0)