Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In GAELYK, how do i store the form-submitted params variable as Text type in entity/datastore

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 ?

like image 619
Kris Avatar asked Dec 12 '25 18:12

Kris


1 Answers

You should just be able to do

book.story = params.description as Text

The converters are described in the second yellow box (at time of posting) on the tutorial page

like image 108
tim_yates Avatar answered Dec 14 '25 16:12

tim_yates



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!