我想将模型的属性设置为不同的东西。当我保存模型时,Backbone发出POST请求而不是PUT请求。执行POST请求而不是PUT请求的骨干
我在另一个Stackoverflow帖子上看到,Backbone使用模型的id来确定模型是否是新建的。当我console.log(model)
,模型有一个id属性。当我console.log(model.id)
,它打印出未定义。如何当我做一个console.log(model)
,模型有一个id属性,但当我做console.log(model.id)
时,我回来undefined?
Backbone使用哪种方式确定模型是否为新模型?而且,我该如何解决这个问题?我正在使用backbone-tastypie。
这有帮助吗? - http://stackoverflow.com/questions/7473057/save-on-existing-model-causes-post-instead-of-put – 2012-07-11 06:17:48