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 o
Ritesh,
Also, BTW, The reason that obj1 and obj2 can have different types of keys is
because the key is not saved on a model level. It is saved at the entity
level. Each entity can have id or key_names.
Apparently obj2 was saved without a key name and was given a numeric key.
obj1 was saved with
Actually, what I meant was:
I cannot have an entity with both key_name and id.
They seem to be mutually exclusive for an entity.
2009/6/23 Ian Lewis :
> Ritesh,
>
> Also, BTW, The reason that obj1 and obj2 can have different types of keys is
> because the key is not saved on a model level. It i
Yes, that is correct.
2009/6/24 Ritesh Nadhani
>
> Actually, what I meant was:
>
> I cannot have an entity with both key_name and id.
>
> They seem to be mutually exclusive for an entity.
>
> 2009/6/23 Ian Lewis :
> > Ritesh,
> >
> > Also, BTW, The reason that obj1 and obj2 can have different ty
Thanks. That is what I was confirming.
2009/6/24 Ian Lewis :
> Yes, that is correct.
>
> 2009/6/24 Ritesh Nadhani
>>
>> Actually, what I meant was:
>>
>> I cannot have an entity with both key_name and id.
>>
>> They seem to be mutually exclusive for an entity.
>>
>> 2009/6/23 Ian Lewis :
>> > Ri