I made a very minor mod to the GqlQuery to retrieve only specified records using the
'where' keyword. The output, however, displays all entries from the guestbook db!
(I need to filter the data by author)
Guestbook5_datastore code:
#greetings = db.GqlQuery("SELECT * FROM Greeting ORDER BY date DESC LIMIT 10")
greetings = db.GqlQuery("...
Hi,
Given document-D1: containing words (w1,w2,w3)
and document D2 and words (w2,w3..)
and document Dn and words ( w1,w2, wn)
Can I structure my data in big table to answer the questions like:
which words occur most frequently with w1,
or which words occur most frequently with w1 and w2.
What I am trying to achieve is to find the...
I'm trying to find the most efficient way to get all objects from the datastore except ones already contained in a list.
Eg. PersistencyManager.getObjectsById(List) will return a list of objects with given ID's. I want a getObjectsExcept(List) method that will return all of the objects that are not contained in the given collection.
...
I have a class in which I have decrlared a serialized class to store image data
@Persistent(serialized = "true")
private DownloadableFile imageLogoFile;
Implementation of the class
public class DownloadableFile implements Serializable {
public DownloadableFile(byte[] content, String filename, String mimeType) {
super();
this....
I have a Model UnitPattern, which reference another Model UnitPatternSet
e.g.
class UnitPattern(db.Model):
unit_pattern_set = db.ReferenceProperty(UnitPatternSet)
in my view I want to display all UnitPatterns having unit_pattern_set refrences as None, but query UnitPattern.all().filter("unit_pattern_set =", None) returns nothing,...
Hey,
I need to make a list property that will contain lists, something like:
db.ListProperty(list(str))
I know list(str) is not a supported value type so as I imagined I received a "ValueError" exception.
Thought maybe there is a creative idea out there of how to overcome this :)
Thanks!
...
I'm trying my hand at google appengine and using the datastore with php and quercus.
I'm not familiar with Java or Python, so lots of learning going on here. I've got pages rendering, and i'm able to get data in and out of the datastore.
The app I am building has users, groups, topics and comments.
A group has users, and users can bel...
I'm having a weird error with some Google App Engine code I'm writing.
My program contains some code like this:
import datetime
...
class Action(db.Model):
visibleDate = db.DateTimeProperty()
...
getActionQuery = Action.gql("WHERE user = :user AND __key__ = :key", user = user, key = self.request.get("key"))
theAction = getActio...
I'm still fairly new to working with java and the google appengine datastore.
I can put data in and get it out of the datastore, and I am trying to make it so that a user cannot be entered twice.
As there is no unique index on the datastore, I'm setting a hash of the users email address as a primarykey.
Strangely, when I enter the sa...
The standard way of doing singletons in Python is
class Singleton(object):
_instance = None
def __new__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super(Singleton, cls).__new__(cls, *args, **kwargs)
return cls._instance
However, this doesn't work on App Engine, since there are may ...
I have a datastore object that uses one of the fields in the class to create the key. Suppose I have an object 'a' with a value 'k' for this field. If I try to add an object 'b' to the datastore, which also has value 'k' for the field, object 'b' overwrites object 'a'. Just wanted to confirm if this is expected behaviour. While it looks ...
In general, it's better to do a single query vs. many queries for a given object. Let's say I have a bunch of 'son' objects each with a 'father'. I get all the 'son' objects:
sons = Son.all()
Then, I'd like to get all the fathers for that group of sons. I do:
father_keys = {}
for son in sons:
father_keys.setdefault(son.father.key...
Hi,
I have a productpart database containing a string property named 'type'.
What I'm trying to do is to get all products by a given type (sometimes more then one type).
I've tried to use GAE filter method but can't get it to work properly.
The only solution I've got working is to make a new db.GqlQuery for each type.
The reason I n...
Right, I don't know if I'm barking entirely up the wrong tree here - I'm finding JDO and the Google AppEngine a bit tricky to get the hang of. Anyway, here goes.
I have a class that contains another class as one of it's internal variables (see player1)
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class JDOGa...
I have a simple model object with
profilename = db.StringProperty()
and when I get a string with "Some More" and try to
put
it in model
it throws exception
Property profilename is not multi-line
Is space equivalent to newline or I have missed something here? It is
put ting
for single word strings without spaces....
I have two models in relation one-to-many:
class Question(db.Model):
questionText = db.StringProperty(multiline=False)
class Answer(db.Model):
answerText = db.StringProperty(multiline=False)
question = db.ReferenceProperty(Question, collection_name='answers')
I have front-end implemented in F...
Hello,
Is there a way to use a real database(SQLite, Mysql, or even some non-relational one) as datastore for development, instead of memory/file datastore that is provided.
I saw few projects, GAE-SQLite(did not seem to be working) and one tip about accessing production datastore using remote api (still pretty slow for large datasets...
I have to add new fields to existing tables. After I add the fields , the application breaks as old records do not have newly added field and throw exception. Is there a way to update all old records with newly added fields?
I need it for a java application on google app engine?
...
If I found information about removing unused indexes, like in Uploading and Managing a Python App / Deleting Unused Indexes, it was only for the Python environment...
Any way to tag an index in the [~project]/war/WEB-INF/datastore-indexes.xml file?
...
I know what you're thinking, 'O not that again!', but here we are since Google have not yet provided a simpler method.
I have been using a queue based solution which worked fine:
import datetime
from models import *
DELETABLE_MODELS = [Alpha, Beta, AlphaBeta]
def initiate_purge():
for e in config.DELETABLE_MODELS:
deferre...