Titanium JIRA Archive
Alloy (ALOY)

[ALOY-829] Add a shorthand for fetch() adapter

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2018-03-05T17:46:33.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.3.0, 2013 Sprint 19
ComponentsModels
Labelsalloy, qe-3.4.0, qe-testadded, query, regression, sqlite
ReporterMotiur Rahman
AssigneeTim Poulsen
Created2013-09-18T06:51:11.000+0000
Updated2018-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)

Comments

  1. Tony Lukasavage 2013-09-18

    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

       [INFO]  Assert single info model returned with "{id:1}": OK
       
    See attached screenshots for how the app should look.
  2. Federico Casali 2013-10-14

    Verified working as expected. TiSDK 3.2.0.v20131013140318 Alloy 1.3.0 CLI 3.2.0 Closing.
  3. Federico Casali 2014-09-04

  4. Eric Merriman 2018-03-05

    Reopening to fix. Unsure how it got into our sprint.

JSON Source