adaptors/backbone/base_model.js
function() {
      var properties = {
        normal: [],
        relational: [],
        derived: []
      };
      var privateProps = this._private || {};
      var relations = _.result(this, 'relations') || {};
      var derived = _.result(this, 'derived') || {};

      var isEditable = function(value) {
        if (!_.isObject(value)) {
          return true;
        } else if (_.isArray(value)) {
          var result = true;
          _.each(value, function(i) {
            result = result && isEditable(i);
          });
          return result;
        } else {
          try {
            JSON.stringify(value);
            return true;
          } catch (ex) {
            return false;
          }
        }
      };

      _.each(this.attributes, function(value, key) {
        if (privateProps[key]) {
          return;
        }
        var prop;
        if (relations && relations[key]) {
          properties.relational.push({
            key: key,
            data: {
              isRelation: true,
              name: value.getDebugName()
            }
          });
        } else if (derived && derived[key]) {
          properties.derived.push({
            key: key,
            data: {
              isDerived: derived[key],
              value: value,
              displayValue: isEditable(value) ? JSON.stringify(value) : Object.prototype.toString.call(value)
            }
          });
        } else {
          prop = {
            key: key,
            data: {
              isEditable: isEditable(value),
              isEditing: false,
              isRemovable: true,
              value: value
            }
          };

          prop.data.displayValue = prop.data.isEditable ? JSON.stringify(value) : Object.prototype.toString.call(value);
          properties.normal.push(prop);
        }
      });

      properties.normal = _.sortBy(properties.normal, 'key');
      properties.relational = _.sortBy(properties.relational, 'key');
      properties.derived = _.sortBy(properties.derived, 'key');

      return properties;
    }
function() {
      var properties = {
        normal: [],
        relational: [],
        derived: []
      };
      var privateProps = this._private || {};
      var relations = _.result(this, 'relations') || {};
      var derived = _.result(this, 'derived') || {};

      var isEditable = function(value) {
        if (!_.isObject(value)) {
          return true;
        } else if (_.isArray(value)) {
          var result = true;
          _.each(value, function(i) {
            result = result && isEditable(i);
          });
          return result;
        } else {
          try {
            JSON.stringify(value);
            return true;
          } catch (ex) {
            return false;
          }
        }
      };

      _.each(this.attributes, function(value, key) {
        if (privateProps[key]) {
          return;
        }
        var prop;
        if (relations && relations[key]) {
          properties.relational.push({
            key: key,
            data: {
              isRelation: true,
              name: value.getDebugName()
            }
          });
        } else if (derived && derived[key]) {
          properties.derived.push({
            key: key,
            data: {
              isDerived: derived[key],
              value: value,
              displayValue: isEditable(value) ? JSON.stringify(value) : Object.prototype.toString.call(value)
            }
          });
        } else {
          prop = {
            key: key,
            data: {
              isEditable: isEditable(value),
              isEditing: false,
              isRemovable: true,
              value: value
            }
          };

          prop.data.displayValue = prop.data.isEditable ? JSON.stringify(value) : Object.prototype.toString.call(value);
          properties.normal.push(prop);
        }
      });

      properties.normal = _.sortBy(properties.normal, 'key');
      properties.relational = _.sortBy(properties.relational, 'key');
      properties.derived = _.sortBy(properties.derived, 'key');

      return properties;
    }
function ( ) { var properties = { normal : [ ] , relational : [ ] , derived : [ ] } ; var privateProps = this . _private || { } ; var relations = _ . result ( this , 'relations' ) || { } ; var derived = _ . result ( this , 'derived' ) || { } ; var isEditable = function ( value ) { if ( ! _ . isObject ( value ) ) { return true ; } else if ( _ . isArray ( value ) ) { var result = true ; _ . each ( value , function ( i ) { result = result && isEditable ( i ) ; } ) ; return result ; } else { try { JSON . stringify ( value ) ; return true ; } catch ( ex ) { return false ; } } } ; _ . each ( this . attributes , function ( value , key ) { if ( privateProps [ key ] ) { return ; } var prop ; if ( relations && relations [ key ] ) { properties . relational . push ( { key : key , data : { isRelation : true , name : value . getDebugName ( ) } } ) ; } else if ( derived && derived [ key ] ) { properties . derived . push ( { key : key , data : { isDerived : derived [ key ] , value : value , displayValue : isEditable ( value ) ? JSON . stringify ( value ) : Object . prototype . toString . call ( value ) } } ) ; } else { prop = { key : key , data : { isEditable : isEditable ( value ) , isEditing : false , isRemovable : true , value : value } } ; prop . data . displayValue = prop . data . isEditable ? JSON . stringify ( value ) : Object . prototype . toString . call ( value ) ; properties . normal . push ( prop ) ; } } ) ; properties . normal = _ . sortBy ( properties . normal , 'key' ) ; properties . relational = _ . sortBy ( properties . relational , 'key' ) ; properties . derived = _ . sortBy ( properties . derived , 'key' ) ; return properties ; }
Get array of attributes, so it can be iterated on

@return {Array<Object>} List of attribute key/values
Get array of attributes so it can be iterated on