dvska / appengine-admin

Automatically exported from code.google.com/p/appengine-admin
0 stars 0 forks source link

Iteration of options fails #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

If you assign a single item to listFields, editFields, or readonlyFields it 
iterates through the characters of the string instead of treating it like an 
array. E.g. if I enter readonlyFields = ("date"), then I get the exception 
"<object> has no property d".

What is the expected output? What do you see instead?
Expect it to be "date" but it is just the first character

What version of the product are you using? On what operating system?
N/A

Please provide any additional information below.

You can fix it by checking to see if the object type is an array before your 
iteration.

________________________________________________________________________________
_____

For any other users encountering this, as a workaround do: listFields = 
(["date"]) instead of listFields = ("date")

Original issue reported on code.google.com by l...@castlemako.com on 8 Nov 2011 at 3:57

GoogleCodeExporter commented 9 years ago
The Python syntax for defining tuple with only one element is:
readonlyFields = ("date",)

Original comment by valdiic on 8 Nov 2011 at 7:53

GoogleCodeExporter commented 9 years ago
Thanks for pointing that out, I've been away from Python for a long time. 
Converting to an array as per my example still worked for me though, obviously.

Original comment by l...@castlemako.com on 8 Nov 2011 at 10:16