[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-21 Thread Tim Hoffman
Mostly Classes CamelCase, modules lowercase, functions, methods and lowercase - is pretty much the norm but not always ;-) T On May 21, 9:47 am, Neal nwalt...@sprynet.com wrote: Thank to all for explaining this mysterious message and showing me the correction. It now works great!  Another

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-21 Thread Tim Hoffman
HI If you are interested here is the python style guide http://www.python.org/dev/peps/pep-0008/ T On May 21, 9:47 am, Neal nwalt...@sprynet.com wrote: Thank to all for explaining this mysterious message and showing me the correction. It now works great!  Another post gave me the clue on

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-20 Thread Nick Johnson (Google)
Hi Neal, djidjadji's response correctly demonstrates what the problem is: The second argument to template.render should be a dictionary, not an individual object. The error you're seeing is because Django is trying to treat your TaskLog object as a dictionary. Change:

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-20 Thread Tim Hoffman
Hi Neal I do use templates but zpt based ones, I am not using any bits of django there are quite a few other python lightweight frameworks running on gae now. For alternatives have a look at things like pylons or repoze, however you will possibly be a bot more on your own as django is a bit of

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-20 Thread Neal
Thank to all for explaining this mysterious message and showing me the correction. It now works great! Another post gave me the clue on how to get the count working. def get(self): query = TaskLog.gql(WHERE resultFlag 0); # get all rows LIMIT = 1000 TaskLogs =

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-19 Thread Neal
Here is the entire template: {%block body%} h2List TaskLogs/h2 !-- List of TaskLogs -- ul table border=1 tr thCustomerBRDomain/th thWorker Email/th thTaskCode/th thStartedTime/th thCompletedTime/th thResultFlag/th thIssue/th /tr {%for TaskLog in TaskLogs%} tr

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-19 Thread Neal
Sorry, I think I posted the wrong template, this is the one causing the error: {%block body%} h2List TaskLogs/h2 !-- List of TaskLogs -- ul table border=1 tr thCustomerBRDomain/th thWorker Email/th thTaskCode/th thStartedTime/th thCompletedTime/th thResultFlag/th thIssue/th /tr

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-19 Thread Tim Hoffman
Hi Here's my guess as to what is going on Somewhere in django has_key(key) is being called which is traditionally a method of a dictionary that can check if a key is in the dictionary. Modern python code should really use key in somedict However app engine datastore class instances have a

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-19 Thread Neal
So basically, are you saying I have to change the Django code to get this work? If that's the case, surely everyone would be having the exact same problem??? How do I find out if I'm up to date or not? I just installed GAE about a month ago. I'm using the django template lib that comes with GAE.

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-19 Thread djidjadji
def get(self): query = db.GqlQuery(Select * from TaskLog) TaskLogs= query.get(); self.renderPage('templates/list.html', TaskLogs) Template {%for TaskLog in TaskLogs%} -- There are two things wrong with this python code The

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-19 Thread Neal
Tim, So you don't use templates at all? Or some other package? I loved what I saw of Django, but then tried to build a vanilla app on GAE. But all the books I had, when talking about templates, used the Django template parser. Thanks, Neal On May 19, 8:00 pm, Tim Hoffman

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-15 Thread Neal
Here's more info. I'm running on my machine using the SDK. Traceback (most recent call last): File C:\Program Files\Google\google_appengine\google\appengine\ext \webapp\__init__.py, line 498, in __call__ handler.get(*groups) File c:\Program Files\Google\google_appengine\demos

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-15 Thread djidjadji
What is the content of the template? There is a for loop executed and there it goes wrong. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to