views:

306

answers:

2

I have developed some applications in Google App Engine but sometimes I have problems to "translate" my rational database mind to datastore objects (most of the time because I don't want to use the Key as ID of the data.) So, if I populate a combo (or any other control) how can I distinguish the uniqueness of the data?

Now I'm reading the data and searching in the datastore, but that doesn't avoid collision when the data is duplicated.

I.e.:

Empresa().all().filter('empresa =',self.request.get("empresa"))
+7  A: 

There are a series of articles on the Google App Engine site that cover many best practices.

James Polley
+1 because i did not know these articles exists
Kristian Damian
+3  A: 

I use this kind of code in my templates

{{ peticion.id }}

but i should use

{{ peticion.key.id }}

and

Empresa.get_by_id(ID)
Kristian Damian