[google-appengine] Re: Apostrophe in key_name error

2009-03-17 Thread Albert


Hi Marzia!

Thank you for replying...

I tried it again, and it didn't work for a while... And then suddenly
it started working... I have completely no idea what went on...

Anyway, thank you!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Apostrophe in key_name error

2009-03-13 Thread Marzia Niccolai
Hi,

Something else has to be going on here, it works for me:

class TestModel(db.Model):
  mystring = db.StringProperty()

class TestPage(webapp.RequestHandler):
  def get(self):
model = TestModel(key_name="test's", mystring="hello")
model.put()

retr = TestModel.get_by_key_name("test's")
self.response.out.write(retr.mystring)

I'm seeing the expected result and the entity as normal in the dataviewer.

Perhaps you can provided some code?

-Marzia

On Thu, Mar 12, 2009 at 8:43 PM, Albert  wrote:

>
> Hi!
>
> I have an object that will be stored with a user-provided key_name.
>
> Everything works fine, until there is an apostrophe (') in the name.
>
> In the SDK, I can store an object in the datastore and retrieve it
> using get_by_key_name() even if it has an apostrophe.
>
> In production, I can only store the object (It's visible in the admin
> data viewer), but cannot retrieve it using get_by_key_name() if the
> key_name contains an apostrophe.
>
> Why is this?
>
>
> Thank you!
>
> P.S. I want the users to be able to enter an apostrophe since I am
> storing lists. And they most likely will name it as "albert's list",
> "raphael's list", etc...
> >
>

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