Found the cause for the error.
I changed a pre-existing field from String to Text. Thought appengine would
automatically change the datatype to Text for the corresponding field in all
existing records. Instead it was treating the particular field of some
records (created prior to datatype change) as strings.

As for finding substrings Text.getValue().Contains(searchstring) works.
Thanks again for your inputs.

Nathan


On Fri, Dec 18, 2009 at 4:59 PM, Manny Nathan <[email protected]> wrote:

> Thanks for the replies. I am using the Java SDK. I have replaced
> String.contains(searchstring) with Text.getValue().Contains(searchstring)
>
> I am able to upload data just fine (strings exceeding 500 characters) but
> when I try to view the data App Engine gives me a exception on my data class
>
> java.lang.ClassCastException: java.lang.String cannot be cast to
> com.google.appengine.api.datastore.Text
>
> When I login to admin console I cansee that the dataviewer still has my
> field as a string (when I try to create a new entity the type it gives is
> string).
>
> If I change text back to string it works again. I tried clearing the
> local_db.bin but still the error persists. Any suggestions?
>
>
> Nathan
>
>
> On Thu, Dec 17, 2009 at 11:35 PM, Wesley Chun <[email protected]> wrote:
>
>> greetings nathan!
>>
>> so, if you were wondering whether you were getting mixed messages from
>> nick and tim... *both* of them are "right." you cannot perform a query
>> on a TextProperty because they are not searchable (as per tim), but if
>> you've already retrieved your object out of the datastore, as nick has
>> said, it's like a normal string so in Python, you could just use the
>> 'in' operator or the normal string methods.
>>
>> hope this makes their answers less confusing!
>> -- wesley
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> "Core Python Programming", Prentice Hall, (c)2007,2001
>> "Python Fundamentals", Prentice Hall, (c)2009
>>   http://corepython.com
>>
>> wesley.j.chun, developer relations, google app engine
>>
>>
>> On Thu, Dec 17, 2009 at 2:15 AM, Manny Nathan <[email protected]>
>> wrote:
>> > Hi,
>> > I am trying to use text objects instead of string to store data (since
>> we
>> > can only store 500 characters in a string). Is there a way to find if
>> the
>> > text object contains a substring? I was using
>> String.contains("findstring")
>> > to find search strings within the string data. I do not see an
>> equivalent
>> > method for the Text object. Any suggestions as to how I should implement
>> > this in code?
>> > Thanks,
>> > Nathan
>>
>>  --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-appengine%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to