[ALOY-829] Add a shorthand for fetch() adapter
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-03-05T17:46:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.3.0, 2013 Sprint 19 |
Components | Models |
Labels | alloy, qe-3.4.0, qe-testadded, query, regression, sqlite |
Reporter | Motiur Rahman |
Assignee | Tim Poulsen |
Created | 2013-09-18T06:51:11.000+0000 |
Updated | 2018-03-05T17:46:38.000+0000 |
Description
If I get a reference to an ID would be nice to have a shortend like
var model = Alloy.createModel("...");
model.fetch({ id: 123 });
instead of have to provide a full sql statement
I suggest an implementation approach like this one
https://github.com/viezel/napp.alloy.adapter.restsql#extended-sql-interface
which would make querying the database more object friendly.
Thanks, Luca
(for original Q&A see http://developer.appcelerator.com/question/157222/fetch-single-record-by-id-via-alloy-models)
PR: https://github.com/appcelerator/alloy/pull/242 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-829
Run test app on ios and/or android
Make sure the app loads the data bound listview with 20 list items
Click any list item
Check the console and confirm that the assertion passes, where the id should correspond the the list item that you clicked
See attached screenshots for how the app should look.
Verified working as expected. TiSDK 3.2.0.v20131013140318 Alloy 1.3.0 CLI 3.2.0 Closing.
Reopening to fix. Unsure how it got into our sprint.