can-restless
A client data model for interacting with data from flask-restless
Note: Can-restless has been built to work with the JSON API specification that
flask-restless is currently developing. To utilize this package, the development version 1.0.0b should be used.
Features
- Full crud api for retrieving, updating, and deleting data
- Retrieve lists of data with filtering, pagination, and sorting
- Pure data model, quickly build your own user interface, or use can-crud
Quick Start
#install flask-restless from github:
virtualenv env
source env/bin/activate
pip install -e git://github.com/jfinkels/flask-restless.git#egg=flask-restless
#install can-restless
npm install can-restless --save
npm run export
AMD
;
Require JS
var Factory = ;var Task = ;
StealJS - ES6 Style Example
;; let TaskMap = CanMap; let Task = ; //fetch the list with no parameterslet deferred = Task; //fetch the list with sortingdeferred = Task; //fetch the list with a filterdeferred = Task; //fetch one item by iddeferred = Task;
Running the tests
Set up flask restless:
cd test/demo
virtualenv env
source env/bin/activate
pip install -r pip_require.txt
python run.py
Once the development server is running, run the tests either in a browser at index.html
or by running
npm run test
Limitations
Filtering:
Currently the only filter syntax supported is the array type with name
, op
, and val
. Each filter in the array will be "and". Or is not currently implemented. For example:
deferred = Task.getList({
filters: [{
name: 'description',
operator: 'like',
value: '%details%'
}, {
name: 'birth_date',
operator: 'after',
value: '10/5/2005'
}]
});
Will query person where name contains "details" AND where birth_date is after October 5, 2005.
Contributing
Contributions from anyone are welcome!
- Pull Requests
- Report Issues via the issue tracker on github
- Feedback and Code Reviews