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...
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
...
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 ...
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...
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...
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=...
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...
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...
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...
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.
...
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...
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?
...
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...
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 ...
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...
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?
...
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...
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...
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...
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)?
...