Ritesh,

Keys can either have a numeric id or a key_name. In order to access the key
name for entities that you saved with a key_name you need to use the
key_name() method.

instead of obj.key().id(),  try obj.key().name()

Incedentally you can also use obj.key().id_or_name() to get either the id or
the name depending on which you are using.

On Wed, Jun 24, 2009 at 3:08 PM, Ritesh Nadhani <rite...@gmail.com> wrote:

>
> Hi
>
> When I save a model with (key_name=...) value, the key does not seem
> to have an id.
>
> Eg.
>
> Mode1(key_name='xxx').put()
>
> obj.key().id() - None
>
> Model2()
>
> obj2.key().id() - 1
>
> Is this intented?
>
> Can I have both key_name and id in a mode?
>
> --
> Ritesh
> http://www.riteshn.com
>
> >
>


-- 
=======================================
株式会社ビープラウド  イアン・ルイス
〒150-0012
東京都渋谷区広尾1-11-2アイオス広尾ビル604
email: ianmle...@beproud.jp
TEL:03-5795-2707
FAX:03-5795-2708
http://www.beproud.jp/
=======================================

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to