What I'm trying to do is query the datastore for a model where the key is not the key of an object I already have. Here's some code:
class User(db.Model):
partner = db.SelfReferenceProperty()
def text_message(self, msg):
user = User.get_or_insert(msg.sender)
if not user.partner:
# user doesn't have a partner, find ...
Hi all,
I'm building a directory for finding athletic tournaments on GAE with
web2py and a Flex front end. The user selects a location, a radius, and a maximum
date from a set of choices. I have a basic version of this query implemented, but it's
inefficient and slow. One way I know I can improve it is by condensing
the many individual ...
I have written an app and part of it is uses a URL parser to get certain data in a ReST type manner. So if you put /foo/bar as the path it will find all the bar items and if you put /foo it will return all items below foo
So my app has a query like
data = Paths.all().filter('path =', self.request.path).get()
Which works brilliantly. ...
Hi,
I am new to Google App Engine,
I have this entites User class -
user_id - integer
user_name - string
password - string
I want to do auto increment for the user_id,How I can do this?
...
I try to get the list of images in Amazon EC2 inside the Google datastore. I want to realize this with a cron job inside the GAE.
class AmazonEC2uswest(db.Model):
ami = db.StringProperty(required=True)
mani = db.StringProperty()
typ = db.StringProperty()
arch = db.StringProperty()
state = db.StringProperty()
owne...
I'm wondering is there a difference in terms of computing cost for the Model.get(keys) and Model.get_by_id(ids, parent=None) methods?
Is there a server side computing advantage of using numeric id's over encoded string keys, or other way around? How big is the difference?
PS. Sorry if it's a dupe. I'm sure I read an article about it, b...
How to construct a GQL query using server side admin datastore viewer, a one that filters on a reference property?
SELECT * from Model where reference_property = <what goes here>
...
On Google App Engine to query the data store with Python, one can use GQL or Entity.all() and then filter it. So for example these are equivalent
gql = "SELECT * FROM User WHERE age >= 18"
db.GqlQuery(gql)
and
query = User.all()
query.filter("age >=", 18)
Now, it's also possible to query things by key name. I know that in GQL you d...
I was uploading the data to App Engine (not dev server) through loader class and remote api, and I hit the quota in the middle of a CSV file. Based on logs and progress sqllite db, how can I select remaining portion of data to be uploaded?
Going through tens of records to determine which was and which was not transfered, is not appealin...
What is the maximum number of characters that can be used to define the key_name of a datastore entity?
Is it bad to have very long key_names?
For example:
Lets say we use key_names of a 170 characters, which is the length of a Twitter message 140 plus 10 numeric characters for latitude and 10 for longtitude and 10 for a timestamp.
...
Are there examples of how to pass a list of key_names to Model.get_or_insert() ?
My Problem:
With a method of ParentLayer I want to make the children.
The key_names of the new (or editable) entities of class Child will come from such a list below:
namesList = ["picture1","picture2"]
so I should be able to build a list of key_names...
I want to create search interface to search data from GAE datastore? Can i use Google Search API to search this way?
...
Is there a datastore performance difference between adding dynamic properties of the expando class when they are needed for an entity or the simpler (for me) framework of just setting up all possible properties I might need from the start even though most instances will just be left empty.
In my specific case I would be having 5-8 empty...
What is the best way to reference datastore model attributes without using the four 'if statements' I have in the below sample code, which seem messy and inefficient. For real-world code I may have a situation of 100 attributes such as self.var1, self.var2, ... self.varN that I want to some how reference with just an integer (or strings)...
Are very large TextProperties a burden? Should they be compressed?
Say I have a information stored in 2 attributes of type TextProperty in my datastore entities.
The strings are always the same length of 65,000 characters and have lots of repeating integers, a sample appearing as follows:
entity.pixel_idx = 0,0,0,0,0,0,0,0,0,1,1,1,1,...
There is little documentation on how to use the low level api for datastore and quite a lot on JPA and JDO and how it translates to it.
My question is: is there any advantage in coding against the JPA or JDO specs instead of accessing directly the low level api for datastore ?
From an initial look, it seems simple and straight forward...
Hi,
UserA and UserB are changing objectA.filedA objectA.filedB respectively and at the same time.
Because they are not changing the same field one might think that there are no overlaps.
Is that true?
or the implementation of pm.makePersistnace() actually override the whole object...
good to know...
...
Hi, I am developing application on app-engine-path and I would like to upload some data to datastore.
For example I have a model
models/places.py:
class Place(db.Model):
name = db.StringProperty()
longitude = db.FloatProperty()
latitude = db.FloatProperty()
If I save this in view, kind() of this entity is "models_place"...
My User object that I want to create and store in the datastore has an email, and a username. How do I make sure when creating my User object that another User object doesn't also have either the same email or the same username?
If I just do a query to see if any other users have already used the username or the email, then there could...
I need to get an App Engine app talking to and sharing data with an external database,
The best option i can come up with is outputting the external database data to an xml file and then processing this in my app engine app and storing it inside the datastore,
although the data being shared is sensitive data such as login details so ou...