Hi

A couple of things

1.  You should try not to use dict as a name . dict is a builtin and
is the other way to create a new dictionary ie. dict()
plus you often use dict for type comparisons  isinstance
(sub_dict,dict) etc....

2.  I am having trouble following your example, but I wonder if
sub_dict should  be  created outside you loop or inside
each iteration (ie is the sub_dict unique for an instance of dict
[key] ) if so then you should be creating a new
sub_dict inside each loop, that might explain things.

But I am not sure as it isn't vbvious where key and
value1,value2,value3 are coming from and what exactly you are trying
to achieve. Because if you get any repeating keys in one of the dicts
the new values will overwrite the old.

Rgds

T

On Mar 30, 9:28 pm, arnie <parvez...@rediffmail.com> wrote:
> Hi all
> First of all an excuse for posting non google app engine topic here
> but as I am new to both google app engine and python so please help
> I have a dictionary dict
> dict={}
> and dict_sub={}
> These two dictionaries are filled using a for loop with the results as
> read from the datastore
> for item in items
>    dict_sub['subid1']=value1
>    dict_sub['subid2']=value2
>    dict_sub['subid3']=value3
>
>    dict[key]=dict_sub
>
> My problem here is that as we cannot apply distinct clause in gqlquery
> I am having some items in dict_sub's [   dict_sub['subid1']=value]
> repeating
> so after generating the dictionary how can I eliminate the sub
> dictionary that is having repeating items
> Please help
> Thanks
--~--~---------~--~----~------------~-------~--~----~
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