TurboGears /.-ed, >new == True< or >new == "True"<
Andy Leszczynski
leszczynscyATnospam.yahoo.com.nospam
Thu Oct 13 01:25:54 EDT 2005
Sybren Stuvel wrote:
> Andy Leszczynski enlightened us with:
>
>>should not it be:
>>
>>2 def save(self, pagename, data, submit, new):
>>3 hub.begin()
>>4 if new == True:
>>5 page = Page(pagename=pagename, data=data)
>>6 else:
>>7 page = Page.byPagename(pagename)
>>8 page.data = data
>>
>>instead of:
>>
>>4 if new == "True":
>
>
> No it should not. The values passed to the function are the strings
> passed by the GET request, hence all strings. There are methods of
> dealing with this - read the rest of the documentation.
>
> Sybren
So how does it correspond to other piece of the code:
2 def notfound(self, pagename):
3 return dict(pagename=pagename, data="", new=True)
new is a boolean here?
A.
More information about the Python-list
mailing list