[background below] I've got my data modelled out in SQLObject in Python on the back-end. Right now I'm converting an SQLObject to a dict, and grabbing all the keys from the dict and then exporting that as a JSON document (so just a JavaScript array). I was planning on doing something like:
Spine.Model.extend({
fromList: function(name, list){
var model = Spine.Model.setup(name, list);
return model;
}
});
Is this a good idea? Does Spine already provide this functionality? Is this the best way to extend the Spine.Model class?
BACKGROUND:
So. I've got a Python application that I've been porting from a GUI app to a web app using Flask.
I'm to the point where I'm doing the view part and realized that it would make a lot of sense to use a JavaScript framework for manipulation of the data/controlling the app/etc.
After a bunch of research I've settled on Spine (the API made the most sense to me on the first read, plus the author wrote the O'Reilly book JavaScript Web Applications so there's a decent reference).
Since I've already got my data modelled out on the backend, I'd like to export that configuration and automate the creation of the Spine models using this so that the data they're recording is always in sync (this way if I change my back-end model, the front-end automatically changes at next page load).