在GAELYK中,如何将表单提交的params变量存储为实体/数据存储区中的Text类型(In GAELYK, how do i store the form

编程入门 行业动态 更新时间:2024-10-28 15:19:55
在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 ?

更多推荐

本文发布于:2023-08-03 06:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1384089.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   变量   如何将   实体   区中

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!