Questions tagged [gqlquery]

129 questions
2
votes
1 answer

How can I Query only __key__ on a Google Appengine PolyModel child?

So the situation is: I want to optimize my code some for doing counting of records. So I have a parent Model class Base, a PolyModel class Entry, and a child class of Entry Article: How would I query Article.key so I can reduce the query load but…
Gabriel
  • 18,322
  • 2
  • 37
  • 44
2
votes
1 answer

What's the raw GQL to check a ReferenceProperty?

I have the following models: class Author(db.Model): name = db.StringProperty() class Story(db.Model): author = db.ReferenceProperty(Author) What's the raw GQL to find all Stories by a certain author. In regular SQL, I will use joins but…
Thierry Lam
  • 45,304
  • 42
  • 117
  • 144
2
votes
1 answer

GQL Query: Delete duplicate rows in GQL from the datastore viewer

I have a simple table with 3 string values. I have discovered several duplicate rows, which are completely identical. What query should I use to delete those duplicate rows (keeping 1 safe)?
Bilbo Baggins
  • 3,644
  • 8
  • 40
  • 64
2
votes
1 answer

Subselect in GQL syntax (Datastore viewer)

I have two entities: Cars (ownerId->String) and Users (userId->String), where ownerId is the foreign key representing userId. I am trying to execute this Query, but I get "GQL syntax" at Datastore Viewer. How can I do this SUBSELECT? SELECT * FROM…
user411103
2
votes
2 answers

Zero results in Query/GqlQuery

How do I know if the results of my query either using the Query interface or the GqlQuery interface returned zero results? Would using .get() on zero results produce an error? If yes, what's the best way to handle it?
Randell
  • 6,112
  • 6
  • 45
  • 70
2
votes
1 answer

GQL Select (including ID) Filter by ID

I was looking for examples wherein in GQL where I can select attributes besides ID and filter by ID as well. The pseudo code of what I want to accomplish is something like this: myResults = db.GQLQuery("select __KEY__, ATTR1, ATTR2 from MyTABLE" …
user1570124
  • 31
  • 1
  • 1
2
votes
3 answers

GAE - How Do i edit / update the datastore in python

I have this datastore model class Project(db.Model) projectname = db.StringProperty() projecturl = db.StringProperty() class Task(db.Model) project = db.ReferenceProperty(Project) taskname= db.StringProperty() taskdesc = db.StringProperty() How do…
gene
  • 41
  • 1
  • 3
2
votes
1 answer

Forming a GQL query with != not equals

I am trying to form a GQL query that: SELECT * FROM IvlsRun where origInstrument = 'Catalyst_Dx' and practiceId != '100004' Finds all IvlsRun(s) where the origInstrument = 'Catalyst_Dx'... but I don't want any of them with practiceId =…
2
votes
1 answer

How to select all rows without references from another model class in GQL?

I have class Question(db.Model): wording = db.StringProperty(required=True) class Answer(db.Model): question = db.ReferenceProperty(Question, required=True) userId = db.IntegerProperty(required=True) And I want to SELECT * FROM…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
2
votes
1 answer

add a value to pre-existing dictionary key in python

I've been trying to add a value to a pre-existing dictionary key. The value comes from the db.Model Car with the property named price. Tried two blocks of code (below) but have been getting the AttributeError: 'GqlQuery' object has no attribute…
mrmo123
  • 725
  • 1
  • 8
  • 23
1
vote
1 answer

GAE gqlquery with variables

If i want to run a GqlQuery with a variable i've set is that possible? for example: myNumber = 4 myResult = db.GqlQuery("SELECT * from myData WHERE filter = myNumber") this results in: Parse Error: Invalid WHERE condition at symbol Am i going…
1
vote
3 answers

Help with Google App Engine query and datetime

I use the following data: date latitude route name longitude 2009-04-11 00:50:31.640000 40.80708 White Loop 86 -77.85891 2009-04-11 00:50:27.718000 40.80708 White Loop 86 -77.85891 2009-04-11…
Alan
1
vote
0 answers

How to extract request payload variable to test from a GQL request payload in postman

I am writing tests in postman and i am having GQL POST request, in which i need to extract the GQL variables in test to validate and write script. But i cant able to extract the GQL variables. Is there any methods available to extract GQL variables…
1
vote
2 answers

Get the Records which contains a word (Case insensitive) in Gql?

Is it possible to write a single Gql Query for retrieving the record which contains a searching string? Data store Contains following Records: addax Crest Addrest Drest Armrest admix I need to get the Records which contains the word "Rest" (Case…
Nijin Narayanan
  • 2,269
  • 2
  • 27
  • 46
1
vote
0 answers

Loop over GqlQuery Fields, App Engine, Python

I want to output all attributes and values of the following GqlQuery: benchmarks = db.GqlQuery("SELECT * FROM Benchmarks") What's the easiest way to loop over the GqlQuery and output the names and values generically? To be more precise, I DO NOT…
Philipp
  • 11
  • 1
1 2
3
8 9