FYI, I do not recommend you use that solution as it registers kind in the
kind_map for all requests used by a given instance. Instead there should be
an option to decode undeclared kinds using an Expando. This feature
actually does exist, though I noticed it was broken when using memcache. I
recommend you file a feature request to support this use case so we can
track a good solution.


On Fri, Oct 11, 2013 at 3:26 AM, Mitul Golakiya <mtl.golak...@gmail.com>wrote:

> Thanks Alftred, It worked...
>
> Thank you so much for you help...
>
>
>
>
> On Friday, October 11, 2013 1:22:22 PM UTC+5:30, Alfred Fuller wrote:
>
>> Thats because you are using 'db' instead of 'ndb'
>>
>>
>> On Fri, Oct 11, 2013 at 12:44 AM, Mitul Golakiya <mtl.go...@gmail.com>wrote:
>>
>>> I have tried this code, but still it is creating entity as class name (*
>>> DynamicEntity*) not as given my custom entity name(*MyCustomEntity*):
>>>
>>>         class DynamicEntity(db.Expando):
>>>             @classmethod
>>>             def _get_kind(cls):
>>>                 return 'MyCustomEntity'
>>>
>>>         newEntity = DynamicEntity()
>>>         newEntity.fname = "Test"
>>>         newEntity.put()
>>>
>>>
>>>
>>>
>>> On Friday, October 11, 2013 11:39:43 AM UTC+5:30, Alfred Fuller wrote:
>>>
>>>> FYI, the following function should be sufficient to register a dynamic
>>>> kind in the kind_map:
>>>>
>>>> def addExpandoForKind(kind):
>>>>   class Dummy(db.Expando):
>>>>     @classmethod
>>>>     def _get_kind(cls):
>>>>       return kind
>>>>
>>>> though it is not a "good" solution :-) (there are all sorts of memory,
>>>> thread and request related issues)
>>>>
>>>>
>>>>
>>>> On Thu, Oct 10, 2013 at 10:54 PM, timh <zute...@gmail.com> wrote:
>>>>
>>>>>  You could use metaclasses to create dynamic models, however you
>>>>> would always have to create a matching class (which would register the
>>>>> class to kind map)
>>>>> before you could perform any query.
>>>>>
>>>>> I think you should elaborate more on what you are trying to do, we may
>>>>> be able to suggest an approach which doesn't require you to go this far.
>>>>>
>>>>> Regards
>>>>>
>>>>> Tim
>>>>>
>>>>>
>>>>> On Wednesday, October 9, 2013 9:32:03 PM UTC+8, Mitul Golakiya wrote:
>>>>>>
>>>>>> Hello All,
>>>>>>
>>>>>> We are developing one app on GAE with python.
>>>>>>
>>>>>> We are using datastore.py for querying data from datastore, because
>>>>>> we have to define our entities at runtime. So we can not use db.Model to
>>>>>> define models. And retrieve data by models.
>>>>>>
>>>>>> We have to use "Not Equal" operator to retrieve some data from
>>>>>> datastore.
>>>>>> Suppose, I want to retrieve all Persons, with name is not equal to
>>>>>> "Test".
>>>>>>
>>>>>> Here is my code :
>>>>>>
>>>>>> filerObj = {}
>>>>>>> filterObj["name!="] = "Test"
>>>>>>>
>>>>>>> dbObj = datastore.Query("Person", filterObj)
>>>>>>> dbObj.Run()
>>>>>>> recordsList = dbObj.Get()
>>>>>>>
>>>>>>
>>>>>>
>>>>>> By this code, we are getting empty result.
>>>>>> Any idea about what's wrong ??
>>>>>>
>>>>>> Thanks in Advance...
>>>>>>
>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Google App Engine" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to google-appengi...@**googlegroups**.com.
>>>>> To post to this group, send email to google-a...@googlegroups.**com.
>>>>>
>>>>> Visit this group at http://groups.google.com/**group**
>>>>> /google-appengine <http://groups.google.com/group/google-appengine>.
>>>>> For more options, visit 
>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>> .
>>>>>
>>>>
>>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google App Engine" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-appengi...@**googlegroups.com.
>>> To post to this group, send email to google-a...@googlegroups.**com.
>>> Visit this group at 
>>> http://groups.google.com/**group/google-appengine<http://groups.google.com/group/google-appengine>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-appengine.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to