From cfed995419dd3c87761d73d8e24959a565679b51 Mon Sep 17 00:00:00 2001 From: loddit Date: Thu, 28 Nov 2013 11:07:20 +0800 Subject: [PATCH 1/2] FAQ update --- docs/FAQ.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index 46fbd54..932d3a9 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -6,7 +6,7 @@ 2. “XMLHttpRequest cannot load http://sfenglish.sx.duapp.com/socket/info. Origin http://sfenglish.duapp.com is not allowed by Access-Control-Allow-Origin.”错误解决。 - 答:该错误说明Clouda服务器代码出险错误,可查看Clouda在BAE上的log定位问题。 + 答:该错误说明你访问的地址和配置的site_url不一致,去 app/server_config/site_url.js 修改 3. 在Controller中使用env.redirect()跳转后出险页面覆盖和重叠的问题? @@ -36,4 +36,4 @@ 7. 出现“MSBUILD : error MSB3428: Could not load the Visual C++ component ‘VCBuild.exe’.” - 答:按照出错之后的提示安装 .NET Framework 2.0 SDK以及安装Microsoft Visual Studio 2005。 \ No newline at end of file + 答:按照出错之后的提示安装 .NET Framework 2.0 SDK以及安装Microsoft Visual Studio 2005。 From ad24fd7035b338f297770de766651c0dd5c6e284 Mon Sep 17 00:00:00 2001 From: loddit Date: Thu, 28 Nov 2013 11:36:30 +0800 Subject: [PATCH 2/2] update docs --- docs/step3_overview.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/step3_overview.md b/docs/step3_overview.md index 7ed6299..a8a21cb 100644 --- a/docs/step3_overview.md +++ b/docs/step3_overview.md @@ -551,6 +551,25 @@ Controller具有以下几个时态:onload()、onrender()、onready()、onsleep 更多内置验证方法和自定义验证方法,请参考附录:《API说明文档》 +* ### function + + 定义Model的function + 给 student 增加 ageAndGender() 。(不要覆盖 get set 等原有 function) + + Model.student = function(exports){ + exports.config = { + fields: [ + {name : 'studentName', type: 'string'}, + {name : 'age', type: 'int'}, + {name : 'gender', type: 'string'} + ] + }; + exports.ageAndGender = function(){ + return this.age + ' ' + this.gender + } + }; + + * #### model 当type值为model和collection时,表示该字段包含一个指向其他model的1:1 或 1:n 的关系。