在GAELYK中,如何将表单提交的params变量存储为实体/数据存储区中的Text类型(In GAELYK, how do i store the form-submitted params variable as Text type in entity/datastore)
我使用Gaelyk在Google应用引擎上构建应用,我有一个表单,提交文本区域的内容(超过500个字符),以保存在数据存储区中。
所以这就是我所做的: -
//add-a-book.groovy import com.google.appengine.api.datastore.Entity def book = new Entity("Book") book.title = params.title book.story = params.description book.save()所以,这个代码不能用作book.story被视为String,因此500个字符限制它,
现在我如何将其定义为Text的数据类型..我理解它是一个初学者问题,任何人都可以帮助吗?
Im using Gaelyk to build an app on Google app engine, I have a form that submits contents of a text-area (which exceeds 500 characters), to be saved in datastore.
so here is what i did :-
//add-a-book.groovy import com.google.appengine.api.datastore.Entity def book = new Entity("Book") book.title = params.title book.story = params.description book.save()So, this code does not work as book.story is being considered as String and hence the 500 chars limit on it,
now how do i define it as a datatype of Text.. i understand its a beginners question, can anybody pls help ?
更多推荐
发布评论