MetroBlooms/evaluate-it — pull request #2 by GregSilverman (2014-04-15 03:15:39+00:00)
Title: Added hierarchical json flattening of associated models

Create a BaseModel with the following methods:

linkAssociations – Iterates over all parent (belongsTo) and straight (hasOne) associations. If the association includes our special foreignStore config we use the StoreManager to find the related record. The link to the related record is stored in a way in which Sencha Touch automatically picks it up.

linkChildAssociations – Used to fetch the direct children (hasMany) of the record and again stored in a way the default model handlers pick it up.

getFlattenedData – Turns a hierarchical structure, fetched with getData, into a flat hash. The keys contain the relations in dot format. This way, the relations can be used for instance in a form panel.

See http://appointsolutions.com/2012/07/using-model-associations-in-sencha-touch-2-and-ext-js-4/

Test this out on Site and Address models before merging into repo.