[google-appengine] Re: Matching date/time GQL query - 500 severe error

2009-05-19 Thread Neal
I switched the GQL Query to the following. Now the GQL Query no longer gives 500 severe error, but almost anything I code after that does give the 500 severe error. I need to test if I returned any rows or not, ideally one. taskLogs = db.GqlQuery("SELECT * FROM TaskLog where taskCode = :

[google-appengine] Re: Matching date/time GQL query - 500 severe error

2009-05-20 Thread Wooble
taskLogs is a db.GqlQuery. The only way it will be None is if the db.GqlQuery() constructor fails horribly. to count rows returned, use count(). On May 19, 4:05 pm, Neal wrote: > I switched the GQL Query to the following. > Now the GQL Query no longer gives 500 severe error, but almost > anyth

[google-appengine] Re: Matching date/time GQL query - 500 severe error

2009-05-20 Thread Neal
But why would testing for None throw a 500 severe error? Seems like it would catch the error and display something more helpful?? I am running with debug=True. Thanks for the clue on "count", here's how I got the count working: def get(self): query = TaskLog.gql("WHERE resultFlag > 0");

[google-appengine] Re: Matching date/time GQL query - 500 severe error

2009-05-20 Thread Neal
Actually, on further testing, my count is still not working, always seems to return 0. TaskLogs is a list of TaskLog objects, right? Neal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. T

[google-appengine] Re: Matching date/time GQL query - 500 severe error

2009-05-21 Thread Nick Johnson (Google)
No, TaskLogs is (in the code snippet you pasted above), a GqlQuery object. To get the list of results, you need to call .fetch(limit), or .count(limit) if you just want a result count. -Nick Johnson On Thu, May 21, 2009 at 2:57 AM, Neal wrote: > > Actually, on further testing, my count is still

[google-appengine] Re: Matching date/time GQL query - 500 severe error

2009-05-21 Thread Neal
I did do a fetch into TaskLogs: TaskLogs = query.fetch (LIMIT,offset=0); My GQL query object is called "query", right? In the template I do this: {%for TaskLog in TaskLogs%}. So that implies to me that TaskLogs is a list, and if I can iterate through it, I should be able to use the native Python C

[google-appengine] Re: Matching date/time GQL query - 500 severe error

2009-05-21 Thread Nick Johnson (Google)
Sorry, I was looking at the wrong snippet. 'count' is not a valid method on a Python list object. Instead, use "len(TaskLogs)", or better just "if TaskLogs", which evaluates to true if TaskLogs is non-empty. -Nick Johnson On Thu, May 21, 2009 at 2:28 PM, Neal wrote: > > I did do a fetch into Ta