gae-datastore

Appengine - Can a user import Yaml or Json file to update datastore with new values?

Imagine this scenario: I made a small application in Python for Google App Engine for general use. Users can login to my app, update their profile, change address and change the picture among many other things. A user can export the models to PDF, YAML and JSON, save the file on his computer. You can download any available format...

Search form in Google App Engine with Mako Template

The script is in data.py and template file is search.mako. The search form is in MainPage method (not included in the code below). I enter the search term but nothing happens. Can you help understand what I am doing wrong? Thank you. class Pet(db.Model): name = db.StringProperty() class Search(webapp.RequestHandler): def post(s...

How to convert integer to string in a query in GAE?

If searchquery is an integer that I am getting from a form; how do I convert it to string? As far as I understand this is the reason why the following code is not working (it works if searchquery is a string: p = Pet.all().filter('score =', self.request.get('searchquery')).fetch(10) Thank you ...

How to use Query.order() on string properties containing non-english characters?

How to use Query.order() on string properties containing non-english characters so entities where fetched in correct order? Query.order is oddly putting any non-english characters on the end of the list, like this: Dolnośląskie Kujawsko-Pomorskie Lubelskie Lubuskie Mazowieckie Małopolskie <- incorrect order Opolskie Podkarpackie Podlas...

Where can I find more diagnostic information about datastore behavior?

I'm using google app engine and its datastore to store a JDO Entity, called A. Class A has a @Persistent member of type B. I'm making changes to A, everything works fine... except this B member is never recorded in the datastore (I don't think). Changes to B don't show up, every fetch I do has B has null even though I clearly set it t...

Minimize subqueries with IN queries on AppEngine (python)

Is there any clever way to avoid making a costly query with an IN clause in cases like the following one? I'm using Google App Engine to build a Facebook application and at some point I (obviously) need to query the datastore to get all the entities that belong to any of the facebook friends of the given user. Suppose I have a couple o...

Protocol Buffers vs JDO on Google App Engine

I'm working on a mobile app that will get data from GAE, and I'm trying to decide between using Protocol Buffers and JDO. First off, I'm not sure how to make PBs persistent. I know it's just a matter of the annotation tags with JDO. I also saw this thread where they warn that PB data can't be indexed. I'm not sure if that's a problem...

Getting The Most Recent Data Item - Google App Engine - Python

I need to retrieve the most recent item added to a collection. Here is how I'm doing it: class Box(db.Model): ID = db.IntegerProperty() class Item(db.Model): box = db.ReferenceProperty(Action, collection_name='items') date = db.DateTimeProperty(auto_now_add=True) #get most recent item lastItem = box.items.order('-date')[0]...

Using ORDER By with DataNucleus Rest API and GAE Datastore

I'm successfully pulling back my objects however, I would like for them to already be sorted by a field in the object. I have this working: new Ajax.Request("/dn/com.emooney.meeting.beans.Meeting?groupName=='"+name+"'" But I want to do something like this: new Ajax.Request("/dn/com.emooney.meeting.beans.Meeting?groupName=='"+name+"...

GAE - retrieving the last entry (python)

I am trying to get the most recent data item from the datastore. I am trying to apply the method as explained here but I am getting the object <__main__.Rep object at 0x075F1730> not the item. Can anyone explain what I am doing wrong? The Model is: class Rep(db.Model): sent = db.StringProperty() time = db.DateTimeProperty(auto_...

GWT: Where (how) to define POJOs to make em available for client and server? (and to use datastore on serverside)

Hi, I try to get an application running which should interact with a server via RPC (JDO in Google DataStore). So I defined a persistent POJO on the server-side to get it put in the datastore via the PersistenceManager (as shown in the gwt rpc tuts). Everything works fine. But I am not able to receive the callback POJO on the client sid...

Python GeoModel alternative

I'm looking for an alternative library for the app engine datastore that will do nearest-n or boxed geo-queries, currently i'm using GeoModel 0.2 and it runs quite slow ( > 1.5s in some cases). Does anyone have any suggestions? Thanks! ...

How to add primitive property to existing java datastore entity to avoid null pointer exception

I have existing entities of a type in my gae datastore to which i want to add a new primitive property of primitive type "long": @Persistent private long bests = 0; When I do this, when i try to load existing entities which obviously don't have this property set yet, i get: java.lang.NullPointerException: Datastore entity wi...

Transaction collision for sequential insert on Google App Engine. Why?

I am inserting a set of records on Google App Engine. I insert them in batch to avoid deadline exceptions. When there is a large number of records (for example 1k) I always receive an unexpected: Transaction collision for entity group with key datastore_types.Key.from_path(u'GroupModel', u'root', _app=u'streamtomail'). R...

GWT problem with Remote Procedure Calls (RPC) and persistent Java objects

Hi, I'm developing a java application using GWT that is hosted on GAE. I'm dealing with RPC for the interaction between the client and the server. The client requests a University to the server via RPC, the server does a query with JDOQL to retrieve the information stored on the GAE database. Until now everything is going well but I ...

App Engine datastore get number of childs from multiple parents

I'm using the datastore of the Google App Engine (DataNucleus). I have two classes, one Chat and one Rating. A chat can be rated more then ones so I created an one-many relationship by adding a list to the Chat class. Now I want to know the number of unrated chats, so I did the following: int numberOfChatsInStock = 0; for(Chat chat : ...

Case-insensitive order_by on GAE using django non-rel

Using google app engine and Django non-rel, I'm querying a list of movies and want to order them alphabetically. movies = Movie.objects.all().order_by("title") The problem is for any titles that do not start with an uppercase character is not following the same sort pattern. So if queried these movies and returned them sorted then "i...

makePersistent is appending elements to my list instead of replacing the list

I'm using the GAE datastore with JDO to hold course information. Each Course has a List of GradeDefinition objects (e.g. "A=90%+", "B=80%+", etc) When I try to change the List, the new elements are simply appended behind the old elements. I suspect there is a problem with the way I am using detachable objects and persistence managers....

Retrieving hierarchial data from datastore

Hi! I am building an app with Google App Engine (and Python). I have two questions about retrieving data from datastore. I have information about users and information about posts made by users. Here is part of DB Models: class User(db.Model): country = db.StringProperty() # many other entities class Post(db.Model): auth...

Reading zip files stored in GAE Blobstore

I have followed the sample code below to upload a zip file in the blobstore. I am able to upload the zip file in but i have some concerns reading the file. Sample Code http://code.google.com/appengine/docs/python/blobstore/overview.html#Complete_Sample_App My zip file has 6 CSV files where my system will read the files and import the ...