gae-datastore

Transaction on GAE entity property

I am trying to create a vote function that increases the class URL.votes +1 when clicked. This is a two part question: How do you pull the entity key? (I think you need the key to distinguish which vote property is being modified?) How do you then write the 'a href' for the link to perform the vote? Thanks! Models: class URL(db.M...

Where is my local App Engine datastore?

How can I find where my local development datastore is located? I am using the Python SDK and Linux. ...

How to update a boolean value in the GAE datastore?

I have the following code from Andreas Borglin's tutorial: @Override public Model saveModel(Model model) { System.out.println("model isDone: " + ((Task)model).getDone()); PersistenceManager pm = PMF.get().getPersistenceManager(); Model savedModel = null; try { savedModel = pm.makePersistent(model); } catch ...

GAE change field name/attribute

Is it possiible to change attribute name on db.Model kind? i have some field name created with dash (e.g. field-name) that resulting error. class DataBulk(db.Model): group_id = db.IntegerProperty() group_name = db.StringProperty() geo_pos = db.GeoPtProperty() group-leader = db.StringProperty() <-----------error impo...

GAE Datastore - Is there a next page / Are there x+1 entities?

Hi. Currently, to determine whether or not there is a next page of entities I'm using the following code: q = Entity.all().fetch(10) cursor = q.cursor() extra = q.fetch(1) has_next_page = False if extra: has_next_page = True However, this is very expensive in terms of the time it takes to execute the 'extra' query. I need to extra...

GAE Query counter (+1000)

How to implement this query counter into existing class? The main purpose is i have datastore model of members with more than 3000 records. I just want to count its total record, and found this on app engine cookbook: def query_counter (q, cursor=None, limit=500): if cursor: q.with_cursor (cursor) count = q.count (limit=...

Google App Engine, JDO, use Date in filter

Hi. In my application, I would like to fetch a set of entities from the Datastore, that have a Date field set to a date before the present moment. I do realize, that one of the ways of doing that is by simply storing the date in those entities as just a long value in milliseconds. But ist there actually a way of storing them as Dates...

is it possible to share a datastore between multiple GAE applications.

I like to work with data saved in one GAE application in other GAE applications. Basically share the datastore between multiple web applications in Google App Engine (Python) Development and Production. Also if possible with: http://localhost:####/_ah/admin/datastore I like to view data in other applications not runnings and/or running...

GAE datastore date property auto produce date of 1970

I have datastore Model bellow: class ThisCategory(search.SearchableModel): ancestor = db.ListProperty(db.Key, default=[]) no_ancestor = db.BooleanProperty(default=True) name = db.StringProperty() description = db.TextProperty() last_modified = db.TimeProperty(auto_now=True) #<----- (1970-01-01 15:36:47.987352) in dat...

How to insert bulk data in Google App Engine Datastore?

Hi All, I have some CSV files for cities,state and countries with their ids, names etc. I want to put all this data into Google app engine datastore. Can someone please suggest an efficient way of doing this on development server as well as on the production server? Thanks in advance. ...

Increasing the number of Models on Google App Engine affects performance?

I made a Google App Engine application as a class project in my university. Now I need to optimize it to use it commercially. Nowadays, the code is very slow. It has only few Models with many properties in each. Before rewriting the Models code, I need to know if my application will be faster if I increase the number of Models, i.e. inc...

Removing Entity from GAE

I am doing some tests with GAE/J. Some days ago I created a model and I have persisted some instances twig-persist. Now that class doesn't exist any more and I want to remove that instances. Can I do it from the Data Viewer or I can only remove it from the code? ...

How do I query a many to many relationship model? - Google App Engine

Here are my models: class User(db.Model): id = db.StringProperty(required=True) created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) name = db.StringProperty(required=True) email = db.StringProperty() class Page(db.Model): id = db.StringProperty(required=True) created...

What's the correct way to store an object in a Model property ?

I need to store a Django template object in a Model property. My solution so far has been to pickle the object before assigning it to a BlobProperty : entity.template_blob = pickle.dumps(template) entity.put() And then after a fetch from the datastore, I do : template = pickle.loads(entity.template_blob) Am I doing this wrong ? I ...

Google App Engine : use mapreduce to empty datastore

I am trying to use an early experimental release of mapper implementation to empty the datastore. This solution was proposed in a similar SO question. This is the AppEngineMapper I am currently using. It just deletes the entity. public class EmptyFixesMapper extends AppEngineMapper<Key, Entity, NullWritable, NullWritable> { publi...

Downloading Google App Engine Database

I had created web application and deploy it in Google App Engine after I created table(entity) in Google App Engine datastore. My doubt is it possible to download the entity/database? ...

Can I have the benefit of parent-child relations without the cost of datastore contention?

Assumptions: 1) Google AppEngine has the concept of Entity Groups. 2) Entities in an entity group form a tree. However, as far as I understood, every put() to any entity in that tree will lock the whole tree (not just the immediate parent) for a while. 3) Users are allowed to write ca. 5 times per seconds to the tree. 4) There is no w...

Google App Engine RemoteApiServlet/remote_api handler errors

Recently, i have come across an error (quite frequently) with the RemoteApiServlet as well as the remote_api handler. While bulk loading large amounts of data using the Bulk Loader, i start seeing random HTTP 500 errors, with the following details (in the log file): Request was aborted after waiting too long to attempt to service your...

App Engine JDO Transaction on multiple many-to-one

I have a simple domain model as follows Driver - key(string), run-count, unique-track-count Track - key(string), run-count, unique-driver-count, best-time Run - key(?), driver-key, track-key, time, boolean-driver-update, boolean-track-updated I need to be able to update a Run and a Driver in the same transaction; as well as a Run and...

Uploading lists with bulkupload in Google App Engine

In my data model, one of my properties is a list. How do I tell the bulk loader to convert the string into a list delimited by ' ' (space)? ...