Re: Using WebAPIResource from Javascript - need Backbone.Model.extend example

2016-05-17 Thread Eric Holmberg
Thanks Christian. I appreciate your help. I went digging through the database model to understand the schema better and ended up using the model directly per your example since I do not need the caching (this is just a low-usage internal review site). I cleaned up the code per your other

Re: Using WebAPIResource from Javascript - need Backbone.Model.extend example

2016-05-11 Thread Christian Hammond
Hi Eric, A couple comments: 1) allowed_methods is a tuple, so it needs to be allowed_methods = ('POST',) Without that comma, it becomes ('P', 'O', 'S', 'T'), preventing HTTP POST from working. 2) resources.reviews.get_object(request, *args, **kwargs) will only work if the URL for your

Re: Using WebAPIResource from Javascript - need Backbone.Model.extend example

2016-05-10 Thread Eric Holmberg
Hi Christian, Here is the core of the extension. The `model` and `uri_object_key` issues are due to the resources.review.get_object() request. Maybe I should be going directly to the database model instead of going through the webapi? class SampleExtensionResource(WebAPIResource):

Re: Using WebAPIResource from Javascript - need Backbone.Model.extend example

2016-05-06 Thread Christian Hammond
Hi Eric, The `model` and `uri_object_key` are configurations for a resource's implementation, and aren't related to the data provided by the caller. The `model` attribute is optionally used to associate a WebAPIResource subclass with a particular database model. If set, many of the operations